feat(irc): add indexer disabled warn log (#1381)

* feat(logs): add indexer enabled check for announce

* logs: update announce.go

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
This commit is contained in:
s0up4200 2024-02-11 10:44:07 +01:00 committed by GitHub
parent 0c65231626
commit cc9656cd41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -29,7 +29,7 @@ type announceProcessor struct {
func NewAnnounceProcessor(log zerolog.Logger, releaseSvc release.Service, indexer *domain.IndexerDefinition) Processor { func NewAnnounceProcessor(log zerolog.Logger, releaseSvc release.Service, indexer *domain.IndexerDefinition) Processor {
ap := &announceProcessor{ ap := &announceProcessor{
log: log.With().Str("module", "announce_processor").Logger(), log: log.With().Str("module", "announce_processor").Str("indexer", indexer.Name).Str("network", indexer.IRC.Network).Logger(),
releaseSvc: releaseSvc, releaseSvc: releaseSvc,
indexer: indexer, indexer: indexer,
} }
@ -75,8 +75,13 @@ func (a *announceProcessor) processQueue(queue chan string) {
a.log.Error().Err(err).Msg("could not get line from queue") a.log.Error().Err(err).Msg("could not get line from queue")
return return
} }
a.log.Trace().Msgf("announce: process line: %v", line) a.log.Trace().Msgf("announce: process line: %v", line)
if !a.indexer.Enabled {
a.log.Warn().Msgf("indexer %v disabled", a.indexer.Name)
}
// check should ignore // check should ignore
match, err := indexer.ParseLine(&a.log, parseLine.Pattern, parseLine.Vars, tmpVars, line, parseLine.Ignore) match, err := indexer.ParseLine(&a.log, parseLine.Pattern, parseLine.Vars, tmpVars, line, parseLine.Ignore)
@ -131,6 +136,7 @@ func (a *announceProcessor) AddLineToQueue(channel string, line string) error {
} }
queue <- line queue <- line
a.log.Trace().Msgf("announce: queued line: %v", line) a.log.Trace().Msgf("announce: queued line: %v", line)
return nil return nil