diff options
author | 2023-03-31 15:19:50 +0200 | |
---|---|---|
committer | 2023-03-31 15:19:50 +0200 | |
commit | 60639a6a0ee9ee79a93d998697b083314e840e9c (patch) | |
tree | cdb3269d2d61224a754bc85a8ee0d62e69184ab5 /internal/processing/media/unattach.go | |
parent | [bugfix] Fix report serialization errors caused by user delete (#1659) (diff) | |
download | gotosocial-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/processing/media/unattach.go')
-rw-r--r-- | internal/processing/media/unattach.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/internal/processing/media/unattach.go b/internal/processing/media/unattach.go index 8cdaf80b2..c6eeac604 100644 --- a/internal/processing/media/unattach.go +++ b/internal/processing/media/unattach.go @@ -21,7 +21,6 @@ import ( "context" "errors" "fmt" - "time" apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model" "github.com/superseriousbusiness/gotosocial/internal/db" @@ -44,11 +43,9 @@ func (p *Processor) Unattach(ctx context.Context, account *gtsmodel.Account, med return nil, gtserror.NewErrorNotFound(errors.New("attachment not owned by requesting account")) } - updatingColumns := []string{"updated_at", "status_id"} - attachment.UpdatedAt = time.Now() attachment.StatusID = "" - if err := p.state.DB.UpdateAttachment(ctx, attachment, updatingColumns...); err != nil { + if err := p.state.DB.UpdateAttachment(ctx, attachment, "status_id"); err != nil { return nil, gtserror.NewErrorNotFound(fmt.Errorf("db error updating attachment: %s", err)) } |