summaryrefslogtreecommitdiff
path: root/internal/media/prune.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-03-31 15:19:50 +0200
committerLibravatar GitHub <noreply@github.com>2023-03-31 15:19:50 +0200
commit60639a6a0ee9ee79a93d998697b083314e840e9c (patch)
treecdb3269d2d61224a754bc85a8ee0d62e69184ab5 /internal/media/prune.go
parent[bugfix] Fix report serialization errors caused by user delete (#1659) (diff)
downloadgotosocial-60639a6a0ee9ee79a93d998697b083314e840e9c.tar.xz
[bugfix] Fix multiple "updated_at" columns for media updates (#1660)
* [bugfix] Fix multiple "updated_at" columns for media updates * silly unrelated race condition
Diffstat (limited to 'internal/media/prune.go')
-rw-r--r--internal/media/prune.go6
1 files changed, 2 insertions, 4 deletions
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) {