diff options
| author | 2023-08-21 15:03:04 +0200 | |
|---|---|---|
| committer | 2023-08-21 17:18:13 +0200 | |
| commit | c7a46e05dbca86b30123cb1c45c1457bbc7a9c4b (patch) | |
| tree | 6678b2390e90f8962a8f5330bb5135cfece1b3e9 /internal/db/bundb/media_test.go | |
| parent | [chore]: Bump codeberg.org/gruf/go-kv from 1.6.3 to 1.6.4 (#2142) (diff) | |
| download | gotosocial-0.11.1.tar.xz | |
[performance] Tweak media attachment cleanup; replace stale index (#2143)v0.11.1
Diffstat (limited to 'internal/db/bundb/media_test.go')
| -rw-r--r-- | internal/db/bundb/media_test.go | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/internal/db/bundb/media_test.go b/internal/db/bundb/media_test.go index 59b927119..691c81729 100644 --- a/internal/db/bundb/media_test.go +++ b/internal/db/bundb/media_test.go @@ -23,7 +23,6 @@ import ( "time" "github.com/stretchr/testify/suite" - "github.com/superseriousbusiness/gotosocial/testrig" ) type MediaTestSuite struct { @@ -43,20 +42,12 @@ func (suite *MediaTestSuite) TestGetOlder() { suite.Len(attachments, 2) } -func (suite *MediaTestSuite) TestGetAvisAndHeaders() { +func (suite *MediaTestSuite) TestGetCachedAttachmentsOlderThan() { ctx := context.Background() - attachments, err := suite.db.GetAvatarsAndHeaders(ctx, "", 20) + attachments, err := suite.db.GetCachedAttachmentsOlderThan(ctx, time.Now(), 20) suite.NoError(err) - suite.Len(attachments, 3) -} - -func (suite *MediaTestSuite) TestGetLocalUnattachedOlderThan() { - ctx := context.Background() - - attachments, err := suite.db.GetLocalUnattachedOlderThan(ctx, testrig.TimeMustParse("2090-06-04T13:12:00Z"), 10) - suite.NoError(err) - suite.Len(attachments, 1) + suite.Len(attachments, 2) } func TestMediaTestSuite(t *testing.T) { |
