From 4cf76a2bfcc2c19bdd34f1bd58d8545d3499481b Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Wed, 21 Sep 2022 19:55:52 +0200 Subject: [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 --- internal/cache/status.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'internal/cache') diff --git a/internal/cache/status.go b/internal/cache/status.go index f3cbce779..898b50846 100644 --- a/internal/cache/status.go +++ b/internal/cache/status.go @@ -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 -- cgit v1.2.3