diff options
author | FChannel <=> | 2021-01-25 11:02:42 -0800 |
---|---|---|
committer | FChannel <=> | 2021-01-25 11:02:42 -0800 |
commit | 3b923a6f098cacf35f309e44a4c67a6a576fba4e (patch) | |
tree | 967d50793a086b9b08d25a83f64f29089d1fcf6c /CacheDatabase.go | |
parent | f6ccb7e03ff6aff01acd7f2b40346156e7b8b10b (diff) |
follow cache sync
Diffstat (limited to 'CacheDatabase.go')
-rw-r--r-- | CacheDatabase.go | 12 |
1 files changed, 9 insertions, 3 deletions
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) |