diff options
author | 2022-11-20 16:33:49 +0000 | |
---|---|---|
committer | 2022-11-20 16:33:49 +0000 | |
commit | 5d55e8d920cd5969e5cff567ee88afb13f40a1b9 (patch) | |
tree | 7ad27cd4ae90a124a8d5ec04e7ff5ac9a1d27d26 /internal/db/bundb/bundb.go | |
parent | [bugfix] fix possible infinite loop on federated AP profile delete (#1091) (diff) | |
download | gotosocial-5d55e8d920cd5969e5cff567ee88afb13f40a1b9.tar.xz |
[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>
Diffstat (limited to 'internal/db/bundb/bundb.go')
-rw-r--r-- | internal/db/bundb/bundb.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/db/bundb/bundb.go b/internal/db/bundb/bundb.go index b316f2106..163174456 100644 --- a/internal/db/bundb/bundb.go +++ b/internal/db/bundb/bundb.go @@ -166,6 +166,7 @@ func NewBunDBService(ctx context.Context) (db.DB, error) { notif := ¬ificationDB{conn: conn} status := &statusDB{conn: conn} emoji := &emojiDB{conn: conn} + relationship := &relationshipDB{conn: conn} timeline := &timelineDB{conn: conn} tombstone := &tombstoneDB{conn: conn} user := &userDB{conn: conn} @@ -174,6 +175,7 @@ func NewBunDBService(ctx context.Context) (db.DB, error) { account.emojis = emoji account.status = status admin.users = user + relationship.accounts = account status.accounts = account status.emojis = emoji status.mentions = mention @@ -185,6 +187,7 @@ func NewBunDBService(ctx context.Context) (db.DB, error) { emoji.init() mention.init() notif.init() + relationship.init() status.init() tombstone.init() user.init() @@ -209,9 +212,7 @@ func NewBunDBService(ctx context.Context) (db.DB, error) { }, Mention: mention, Notification: notif, - Relationship: &relationshipDB{ - conn: conn, - }, + Relationship: relationship, Session: &sessionDB{ conn: conn, }, |