[chore] Tidy up status deletion, remove from cache too (#845)

* add func for deleting status from db + cache

* move deletes entirely back to processor
and also only do a delete if the requesting account owns the item being deleted

* tidy up unboost processing

* delete status more efficiently

* fix wrong account id on remote test attachments

* fix federator test
This commit is contained in:
tobi
2022-09-21 19:55:52 +02:00
committed by GitHub
parent 8c20626c51
commit 4cf76a2bfc
12 changed files with 113 additions and 94 deletions

View File

@@ -85,6 +85,11 @@ func (c *StatusCache) Put(status *gtsmodel.Status) {
c.cache.Set(status.ID, copyStatus(status))
}
// Invalidate invalidates one status from the cache using the ID of the status as key.
func (c *StatusCache) Invalidate(statusID string) {
c.cache.Invalidate(statusID)
}
// copyStatus performs a surface-level copy of status, only keeping attached IDs intact, not the objects.
// due to all the data being copied being 99% primitive types or strings (which are immutable and passed by ptr)
// this should be a relatively cheap process