mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-02 01:32:24 -06: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:
parent
8c20626c51
commit
4cf76a2bfc
12 changed files with 113 additions and 94 deletions
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue