diff options
author | FChannel <=> | 2021-01-24 22:35:03 -0800 |
---|---|---|
committer | FChannel <=> | 2021-01-24 22:35:03 -0800 |
commit | f6ccb7e03ff6aff01acd7f2b40346156e7b8b10b (patch) | |
tree | dc164f98deb8ba5e2efebaf8a2bca253b3a3cdaf /Database.go | |
parent | 3d307abbdf1c0ee711c80c753930a88014c8925a (diff) |
getting cached replies
Diffstat (limited to 'Database.go')
-rw-r--r-- | Database.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Database.go b/Database.go index 9ebf000..cdf23e7 100644 --- a/Database.go +++ b/Database.go @@ -390,6 +390,13 @@ func GetObjectFromDB(db *sql.DB, actor Actor) Collection { post.Replies.TotalItems, post.Replies.TotalImgs = GetObjectRepliesDBCount(db, post) + var localPost ObjectBase + localPost.Replies, postCnt, imgCnt = GetObjectRepliesCache(db, post) + + for _, e := range localPost.Replies.OrderedItems { + post.Replies.OrderedItems = append(post.Replies.OrderedItems, e) + } + post.Replies.TotalItems = post.Replies.TotalItems + postCnt post.Replies.TotalImgs = post.Replies.TotalImgs + imgCnt |