From 3b923a6f098cacf35f309e44a4c67a6a576fba4e Mon Sep 17 00:00:00 2001 From: FChannel <=> Date: Mon, 25 Jan 2021 11:02:42 -0800 Subject: follow cache sync --- CacheDatabase.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'CacheDatabase.go') diff --git a/CacheDatabase.go b/CacheDatabase.go index 992a160..9de9c78 100644 --- a/CacheDatabase.go +++ b/CacheDatabase.go @@ -20,7 +20,13 @@ func WriteObjectToCache(db *sql.DB, obj ObjectBase) ObjectBase { WriteActivitytoCache(db, obj) } - writeObjectReplyToDB(db, obj) + writeObjectReplyToDB(db, obj) + + if obj.Replies != nil { + for _, e := range obj.Replies.OrderedItems { + WriteObjectToCache(db, e) + } + } return obj } @@ -608,8 +614,8 @@ func DeleteActorCache(db *sql.DB, actorID string) { } func WriteActorToCache(db *sql.DB, actorID string) { - actor := GetActor(actorID) - collection := GetActorCollection(actor.Outbox) + actor := GetActor(actorID) + collection := GetActorCollection(actor.Outbox) for _, e := range collection.OrderedItems { WriteObjectToCache(db, e) -- cgit v1.2.3