diff options
| author | 2021-08-27 10:38:24 +0100 | |
|---|---|---|
| committer | 2021-08-27 11:38:24 +0200 | |
| commit | 87328b62180ada949ba6afde36db0d3acb819698 (patch) | |
| tree | 94081aef3e27c4b63497e03d0119c0eb5ab2bc8b /internal/db | |
| parent | some more little fixes for all to enjoy (#161) (diff) | |
| download | gotosocial-87328b62180ada949ba6afde36db0d3acb819698.tar.xz | |
fix new tx within tx (#163)
Signed-off-by: kim (grufwub) <grufwub@gmail.com>
Diffstat (limited to 'internal/db')
| -rw-r--r-- | internal/db/bundb/status.go | 5 | 
1 files changed, 1 insertions, 4 deletions
diff --git a/internal/db/bundb/status.go b/internal/db/bundb/status.go index da8d8ca41..2019322ac 100644 --- a/internal/db/bundb/status.go +++ b/internal/db/bundb/status.go @@ -122,7 +122,6 @@ func (s *statusDB) GetStatusByID(ctx context.Context, id string) (*gtsmodel.Stat  		Where("status.id = ?", id)  	err := processErrorResponse(q.Scan(ctx)) -  	if err != nil {  		return nil, err  	} @@ -145,7 +144,6 @@ func (s *statusDB) GetStatusByURI(ctx context.Context, uri string) (*gtsmodel.St  		Where("LOWER(status.uri) = LOWER(?)", uri)  	err := processErrorResponse(q.Scan(ctx)) -  	if err != nil {  		return nil, err  	} @@ -168,7 +166,6 @@ func (s *statusDB) GetStatusByURL(ctx context.Context, uri string) (*gtsmodel.St  		Where("LOWER(status.url) = LOWER(?)", uri)  	err := processErrorResponse(q.Scan(ctx)) -  	if err != nil {  		return nil, err  	} @@ -206,7 +203,7 @@ func (s *statusDB) PutStatus(ctx context.Context, status *gtsmodel.Status) db.Er  		for _, a := range status.Attachments {  			a.StatusID = status.ID  			a.UpdatedAt = time.Now() -			if _, err := s.conn.NewUpdate().Model(a). +			if _, err := tx.NewUpdate().Model(a).  				Where("id = ?", a.ID).  				Exec(ctx); err != nil {  				return err  | 
