summaryrefslogtreecommitdiff
path: root/internal/db/bundb/relationship_test.go
diff options
context:
space:
mode:
authorLibravatar kim <grufwub@gmail.com>2025-10-17 19:41:06 +0200
committerLibravatar tobi <tobi.smethurst@protonmail.com>2025-11-17 14:11:23 +0100
commit14bf8e62f81d7eac637f2097a88b4c3c32a8a7b5 (patch)
tree56b675dadea6b525336ec9c109d932c224df9df5 /internal/db/bundb/relationship_test.go
parent[chore] update dependencies (#4507) (diff)
downloadgotosocial-14bf8e62f81d7eac637f2097a88b4c3c32a8a7b5.tar.xz
[performance] reduce account stats database calls (#4496)
Reduces both code complexity and the number of separate database transactions we need to make by moving account statistics operations into the database as side-effects of the operations that effect them. In contrast to currently, where we manually update account statistics at the application layer. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4496 Co-authored-by: kim <grufwub@gmail.com> Co-committed-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/db/bundb/relationship_test.go')
-rw-r--r--internal/db/bundb/relationship_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/db/bundb/relationship_test.go b/internal/db/bundb/relationship_test.go
index a8b456286..c1336aa50 100644
--- a/internal/db/bundb/relationship_test.go
+++ b/internal/db/bundb/relationship_test.go
@@ -194,7 +194,7 @@ func (suite *RelationshipTestSuite) TestGetFollowBy() {
// Attempt to place the follow in database (if not already).
if err := suite.db.PutFollow(ctx, follow); err != nil {
- if err != db.ErrAlreadyExists {
+ if !errors.Is(err, db.ErrAlreadyExists) {
// Unrecoverable database error.
t.Fatalf("error creating follow: %v", err)
}
@@ -306,7 +306,7 @@ func (suite *RelationshipTestSuite) TestGetFollowRequestBy() {
// Attempt to place the follow in database (if not already).
if err := suite.db.PutFollowRequest(ctx, followReq); err != nil {
- if err != db.ErrAlreadyExists {
+ if !errors.Is(err, db.ErrAlreadyExists) {
// Unrecoverable database error.
t.Fatalf("error creating follow request: %v", err)
}