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/federatingprotocol_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/federation/federatingprotocol_test.go') diff --git a/internal/federation/federatingprotocol_test.go b/internal/federation/federatingprotocol_test.go index 1eb5f133c..69ce1a6c0 100644 --- a/internal/federation/federatingprotocol_test.go +++ b/internal/federation/federatingprotocol_test.go @@ -312,7 +312,7 @@ func (suite *FederatingProtocolTestSuite) TestBlocked2() { ctxWithOtherInvolvedIRIs := context.WithValue(ctxWithRequestingAccount, ap.ContextOtherInvolvedIRIs, otherInvolvedIRIs) // insert a block from inboxAccount targeting sendingAccount - if err := suite.db.Put(context.Background(), >smodel.Block{ + if err := suite.db.PutBlock(context.Background(), >smodel.Block{ ID: "01G3KBEMJD4VQ2D615MPV7KTRD", URI: "whatever", AccountID: inboxAccount.ID, @@ -350,7 +350,7 @@ func (suite *FederatingProtocolTestSuite) TestBlocked3() { ctxWithOtherInvolvedIRIs := context.WithValue(ctxWithRequestingAccount, ap.ContextOtherInvolvedIRIs, otherInvolvedIRIs) // insert a block from inboxAccount targeting CCed account - if err := suite.db.Put(context.Background(), >smodel.Block{ + if err := suite.db.PutBlock(context.Background(), >smodel.Block{ ID: "01G3KBEMJD4VQ2D615MPV7KTRD", URI: "whatever", AccountID: inboxAccount.ID, -- cgit v1.2.3