mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[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:
5
internal/cache/status.go
vendored
5
internal/cache/status.go
vendored
@@ -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
|
||||
|
Reference in New Issue
Block a user