mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 14:12:24 -05:00
[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:
parent
d9bbcc60a6
commit
60639a6a0e
3 changed files with 4 additions and 9 deletions
|
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue