From 60639a6a0ee9ee79a93d998697b083314e840e9c Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Fri, 31 Mar 2023 15:19:50 +0200 Subject: [bugfix] Fix multiple "updated_at" columns for media updates (#1660) * [bugfix] Fix multiple "updated_at" columns for media updates * silly unrelated race condition --- internal/media/prune.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'internal/media/prune.go') diff --git a/internal/media/prune.go b/internal/media/prune.go index da842a84d..f0d0516e1 100644 --- a/internal/media/prune.go +++ b/internal/media/prune.go @@ -328,10 +328,8 @@ func (m *manager) uncacheAttachment(ctx context.Context, attachment *gtsmodel.Me } // Update attachment to reflect that we no longer have it cached. - attachment.UpdatedAt = time.Now() - cached := false - attachment.Cached = &cached - return m.state.DB.UpdateAttachment(ctx, attachment, "updated_at", "cached") + attachment.Cached = func() *bool { i := false; return &i }() + return m.state.DB.UpdateAttachment(ctx, attachment, "cached") } func (m *manager) removeFiles(ctx context.Context, keys ...string) (int, error) { -- cgit v1.2.3