Use RemoteUrl instead of PreviewUrl and increase API timeout to 60 seconds
This commit is contained in:
@@ -16,7 +16,6 @@ func main() {
|
||||
// Setup config
|
||||
config.Init()
|
||||
|
||||
|
||||
// Initialize database
|
||||
database.Init()
|
||||
|
||||
@@ -26,7 +25,7 @@ func main() {
|
||||
|
||||
runFetchPosts := func() {
|
||||
// Get posts
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
|
||||
defer cancel()
|
||||
var posts []domain.Post = nil
|
||||
err, posts := services.PostServiceInstance.GetPostsFromApi(ctx, config.Config.Tag, config.Config.Instance)
|
||||
|
@@ -22,6 +22,6 @@ func (ps *EmbedCardHandler) GetEmbedCard(c *gin.Context) {
|
||||
post := ps.PostService.GetRandomPost()
|
||||
c.HTML(200, "home/embed.html", gin.H{
|
||||
"postUrl": post.Url,
|
||||
"imageUrl": post.Attachments[0].PreviewUrl,
|
||||
"imageUrl": post.Attachments[0].RemoteUrl,
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user