mirror of
https://github.com/idanoo/autobrr
synced 2025-07-22 16:29:12 +00:00
fix(database): fix filter regression from clean-up (#599)
* fix(database): fix filter regression from clean-up * rollback transaction commits * fix(database): revert action count query
This commit is contained in:
parent
6b1490726f
commit
5da28a0918
3 changed files with 4 additions and 19 deletions
|
@ -28,7 +28,6 @@ func NewActionRepo(log logger.Logger, db *DB, clientRepo domain.DownloadClientRe
|
|||
}
|
||||
|
||||
func (r *ActionRepo) FindByFilterID(ctx context.Context, filterID int) ([]*domain.Action, error) {
|
||||
|
||||
tx, err := r.db.BeginTx(ctx, &sql.TxOptions{Isolation: sql.LevelReadCommitted})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -51,10 +50,6 @@ func (r *ActionRepo) FindByFilterID(ctx context.Context, filterID int) ([]*domai
|
|||
}
|
||||
}
|
||||
|
||||
if err = tx.Commit(); err != nil {
|
||||
return nil, errors.Wrap(err, "error finding filter by id")
|
||||
}
|
||||
|
||||
return actions, nil
|
||||
}
|
||||
|
||||
|
@ -611,8 +606,7 @@ func (r *ActionRepo) StoreFilterActions(ctx context.Context, actions []*domain.A
|
|||
r.log.Debug().Msgf("action.StoreFilterActions: store '%v' type: '%v' on filter: %v", action.Name, action.Type, filterID)
|
||||
}
|
||||
|
||||
err = tx.Commit()
|
||||
if err != nil {
|
||||
if err := tx.Commit(); err != nil {
|
||||
return nil, errors.Wrap(err, "error updating filter actions")
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue