From 6e947ff2662d0b9fc475c5b21e9f1cfb0bb308a0 Mon Sep 17 00:00:00 2001 From: Sashanoraa Date: Sun, 15 May 2022 08:52:46 -0400 Subject: [feature] Media cleanup endpoint (#560) Adds an admin endpoint to trigger a remote media cleanup. Fixed #348 Signed-off-by: Sashanoraa --- internal/media/pruneremote_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/media') diff --git a/internal/media/pruneremote_test.go b/internal/media/pruneremote_test.go index 9f3b65dd2..c9d040a6f 100644 --- a/internal/media/pruneremote_test.go +++ b/internal/media/pruneremote_test.go @@ -39,7 +39,7 @@ func (suite *PruneRemoteTestSuite) TestPruneRemote() { totalPruned, err := suite.manager.PruneRemote(context.Background(), 1) suite.NoError(err) - suite.Equal(1, totalPruned) + suite.Equal(2, totalPruned) prunedAttachment, err := suite.db.GetAttachmentByID(context.Background(), testAttachment.ID) suite.NoError(err) @@ -51,7 +51,7 @@ func (suite *PruneRemoteTestSuite) TestPruneRemote() { func (suite *PruneRemoteTestSuite) TestPruneRemoteTwice() { totalPruned, err := suite.manager.PruneRemote(context.Background(), 1) suite.NoError(err) - suite.Equal(1, totalPruned) + suite.Equal(2, totalPruned) // final prune should prune nothing, since the first prune already happened totalPrunedAgain, err := suite.manager.PruneRemote(context.Background(), 1) @@ -65,7 +65,7 @@ func (suite *PruneRemoteTestSuite) TestPruneAndRecache() { totalPruned, err := suite.manager.PruneRemote(ctx, 1) suite.NoError(err) - suite.Equal(1, totalPruned) + suite.Equal(2, totalPruned) // media should no longer be stored _, err = suite.storage.Get(testAttachment.File.Path) @@ -118,7 +118,7 @@ func (suite *PruneRemoteTestSuite) TestPruneOneNonExistent() { // Now attempt to prune remote for item with db entry no file totalPruned, err := suite.manager.PruneRemote(ctx, 1) suite.NoError(err) - suite.Equal(1, totalPruned) + suite.Equal(2, totalPruned) } func TestPruneRemoteTestSuite(t *testing.T) { -- cgit v1.2.3