summaryrefslogtreecommitdiff
path: root/internal/db/bundb/media_test.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-08-21 15:03:04 +0200
committerLibravatar GitHub <noreply@github.com>2023-08-21 14:03:04 +0100
commit638f023a1c03a17881be76e8a3de3ceda417393d (patch)
treed092b14500b935ed9fd57680a1f7cb6db8f4e54a /internal/db/bundb/media_test.go
parent[chore]: Bump codeberg.org/gruf/go-kv from 1.6.3 to 1.6.4 (#2142) (diff)
downloadgotosocial-638f023a1c03a17881be76e8a3de3ceda417393d.tar.xz
[performance] Tweak media attachment cleanup; replace stale index (#2143)
Diffstat (limited to 'internal/db/bundb/media_test.go')
-rw-r--r--internal/db/bundb/media_test.go15
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) {