mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 15:32:25 -05:00
[performance] add account block DB cache and remove block query joins (#1085)
* add account block DB cache and remove reliance on relational joins * actually include cache key arguments... * add a PutBlock() method which also updates the block cache, update tests accordingly * use `PutBlock` instead of `Put(ctx, block)` * add + use functions for deleting + invalidating blocks Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
This commit is contained in:
parent
9be16852f2
commit
5d55e8d920
11 changed files with 319 additions and 80 deletions
|
|
@ -114,7 +114,7 @@ func (f *federatingDB) Undo(ctx context.Context, undo vocab.ActivityStreamsUndo)
|
|||
return errors.New("UNDO: block object account and inbox account were not the same")
|
||||
}
|
||||
// delete any existing BLOCK
|
||||
if err := f.db.DeleteWhere(ctx, []db.Where{{Key: "uri", Value: gtsBlock.URI}}, >smodel.Block{}); err != nil {
|
||||
if err := f.db.DeleteBlockByURI(ctx, gtsBlock.URI); err != nil {
|
||||
return fmt.Errorf("UNDO: db error removing block: %s", err)
|
||||
}
|
||||
l.Debug("block undone")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue