mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
Feature: Support multiline irc parsing (#39)
* feat: initial multiline support * refactor: handle multiple indexers per network * wip: setup indexer * build: add docker compose for testing * chore: remove temp mock indexers * chore: update deps * refactor: update and store network handler * build: update test compose * chore: minor cleanup
This commit is contained in:
parent
506cef6f0f
commit
c4d580eb03
17 changed files with 1100 additions and 1042 deletions
|
@ -1,9 +1,9 @@
|
|||
package database
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/autobrr/autobrr/internal/domain"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
@ -139,17 +139,16 @@ func (r *IndexerRepo) FindByFilterID(id int) ([]domain.Indexer, error) {
|
|||
|
||||
}
|
||||
|
||||
func (r *IndexerRepo) Delete(id int) error {
|
||||
func (r *IndexerRepo) Delete(ctx context.Context, id int) error {
|
||||
query := `DELETE FROM indexer WHERE id = ?`
|
||||
|
||||
res, err := r.db.Exec(`DELETE FROM indexer WHERE id = ?`, id)
|
||||
_, err := r.db.ExecContext(ctx, query, id)
|
||||
if err != nil {
|
||||
log.Error().Stack().Err(err).Msg("error executing query")
|
||||
log.Error().Stack().Err(err).Msgf("indexer.delete: error executing query: '%v'", query)
|
||||
return err
|
||||
}
|
||||
|
||||
rows, _ := res.RowsAffected()
|
||||
|
||||
log.Info().Msgf("rows affected %v", rows)
|
||||
log.Debug().Msgf("indexer.delete: id %v", id)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue