From 5d55e8d920cd5969e5cff567ee88afb13f40a1b9 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:33:49 +0000 Subject: [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 Co-authored-by: tsmethurst --- internal/federation/federatingdb/undo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal/federation/federatingdb/undo.go') diff --git a/internal/federation/federatingdb/undo.go b/internal/federation/federatingdb/undo.go index 4cb3d0fa8..792297683 100644 --- a/internal/federation/federatingdb/undo.go +++ b/internal/federation/federatingdb/undo.go @@ -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") -- cgit v1.2.3