[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:
kim
2022-11-20 16:33:49 +00:00
committed by GitHub
parent 9be16852f2
commit 5d55e8d920
11 changed files with 319 additions and 80 deletions

View File

@ -153,7 +153,7 @@ func (suite *InboxPostTestSuite) TestPostUnblock() {
TargetAccountID: blockedAccount.ID,
}
err = suite.db.Put(context.Background(), dbBlock)
err = suite.db.PutBlock(context.Background(), dbBlock)
suite.NoError(err)
asBlock, err := suite.tc.BlockToAS(context.Background(), dbBlock)