fixed gallery comment cache

This commit is contained in:
orangix
2023-08-15 19:56:33 +02:00
parent ab95ee5e2b
commit 268dbe3d35

View File

@@ -9,6 +9,7 @@ import (
"codeberg.org/rimgo/rimgo/utils" "codeberg.org/rimgo/rimgo/utils"
"github.com/dustin/go-humanize" "github.com/dustin/go-humanize"
"github.com/microcosm-cc/bluemonday" "github.com/microcosm-cc/bluemonday"
"github.com/patrickmn/go-cache"
"github.com/tidwall/gjson" "github.com/tidwall/gjson"
"gitlab.com/golang-commonmark/linkify" "gitlab.com/golang-commonmark/linkify"
) )
@@ -55,6 +56,7 @@ func (client *Client) FetchComments(galleryID string) ([]Comment, error) {
) )
wg.Wait() wg.Wait()
client.Cache.Set(galleryID+"-comments", comments, cache.DefaultExpiration)
return comments, nil return comments, nil
} }