From 3cceed11b28b5f42a653d85ed779d652fd8c26ad Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Tue, 16 Apr 2024 13:10:13 +0200 Subject: [feature/performance] Store account stats in separate table (#2831) * [feature/performance] Store account stats in separate table, get stats from remote * test account stats * add some missing increment / decrement calls * change stats function signatures * rejig logging a bit * use lock when updating stats --- internal/db/bundb/relationship_test.go | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'internal/db/bundb/relationship_test.go') diff --git a/internal/db/bundb/relationship_test.go b/internal/db/bundb/relationship_test.go index 9858e4768..f1d1a35d2 100644 --- a/internal/db/bundb/relationship_test.go +++ b/internal/db/bundb/relationship_test.go @@ -773,20 +773,6 @@ func (suite *RelationshipTestSuite) TestGetAccountFollows() { suite.Len(follows, 2) } -func (suite *RelationshipTestSuite) TestCountAccountFollowsLocalOnly() { - account := suite.testAccounts["local_account_1"] - followsCount, err := suite.db.CountAccountLocalFollows(context.Background(), account.ID) - suite.NoError(err) - suite.Equal(2, followsCount) -} - -func (suite *RelationshipTestSuite) TestCountAccountFollows() { - account := suite.testAccounts["local_account_1"] - followsCount, err := suite.db.CountAccountFollows(context.Background(), account.ID) - suite.NoError(err) - suite.Equal(2, followsCount) -} - func (suite *RelationshipTestSuite) TestGetAccountFollowers() { account := suite.testAccounts["local_account_1"] follows, err := suite.db.GetAccountFollowers(context.Background(), account.ID, nil) @@ -794,20 +780,6 @@ func (suite *RelationshipTestSuite) TestGetAccountFollowers() { suite.Len(follows, 2) } -func (suite *RelationshipTestSuite) TestCountAccountFollowers() { - account := suite.testAccounts["local_account_1"] - followsCount, err := suite.db.CountAccountFollowers(context.Background(), account.ID) - suite.NoError(err) - suite.Equal(2, followsCount) -} - -func (suite *RelationshipTestSuite) TestCountAccountFollowersLocalOnly() { - account := suite.testAccounts["local_account_1"] - followsCount, err := suite.db.CountAccountLocalFollowers(context.Background(), account.ID) - suite.NoError(err) - suite.Equal(2, followsCount) -} - func (suite *RelationshipTestSuite) TestUnfollowExisting() { originAccount := suite.testAccounts["local_account_1"] targetAccount := suite.testAccounts["admin_account"] -- cgit v1.2.3