log enabled dep

This commit is contained in:
nquidox 2026-04-08 12:15:24 +03:00
parent c5013c03ff
commit b29e60b712
6 changed files with 39 additions and 21 deletions

View file

@ -33,8 +33,8 @@ func NewApp(ctx context.Context, cfg config.Config) *App {
Pass: cfg.Rabbit.Pass,
Vhost: cfg.Rabbit.Vhost,
},
ChanLen: cfg.App.ProcChanLen,
LoggerEnabled: false,
LoggingEnabled: cfg.Rabbit.LoggingEnabled,
ChanLen: cfg.App.ProcChanLen,
})
return &App{
@ -53,11 +53,13 @@ func (app *App) Run(ctx context.Context) error {
defer mainLoop.Stop()
go func() {
log.Info("Process tasks after start")
if err := app.processor.ProcessTasks(ctx); err != nil {
errChan <- err
}
for range mainLoop.C {
log.WithField("period", app.config.App.CheckPeriod).Info("Repeated process tasks")
if err := app.processor.ProcessTasks(ctx); err != nil {
errChan <- err
}