feat(filters): duplicate (#168)

This commit is contained in:
Ludvig Lundgren 2022-03-06 16:08:07 +01:00 committed by GitHub
parent 72b74f9d19
commit cb6cbb83d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 115 additions and 12 deletions

View file

@ -217,7 +217,7 @@ func (r *FilterRepo) FindByIndexerIdentifier(indexer string) ([]domain.Filter, e
return filters, nil
}
func (r *FilterRepo) Store(filter domain.Filter) (*domain.Filter, error) {
func (r *FilterRepo) Store(ctx context.Context, filter domain.Filter) (*domain.Filter, error) {
//r.db.lock.RLock()
//defer r.db.lock.RUnlock()
@ -227,7 +227,7 @@ func (r *FilterRepo) Store(filter domain.Filter) (*domain.Filter, error) {
} else {
var res sql.Result
res, err = r.db.handler.Exec(`INSERT INTO filter (
res, err = r.db.handler.ExecContext(ctx, `INSERT INTO filter (
name,
enabled,
min_size,