[bugfix] Fix multiple "updated_at" columns for media updates (#1660)

* [bugfix] Fix multiple "updated_at" columns for media updates

* silly unrelated race condition
This commit is contained in:
tobi
2023-03-31 15:19:50 +02:00
committed by GitHub
parent d9bbcc60a6
commit 60639a6a0e
3 changed files with 4 additions and 9 deletions

View File

@@ -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) {