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:
Ludvig Lundgren 2021-12-21 21:15:42 +01:00 committed by GitHub
parent 506cef6f0f
commit c4d580eb03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 1100 additions and 1042 deletions

View file

@ -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
}