diff --git a/CHANGELOG.md b/CHANGELOG.md index d001908..76f453f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added - `PreEnqueueFunc`, `PostEnqueueFunc` is added in `Scheduler` and deprecated `EnqueueErrorHandler` (PR: https://github.com/hibiken/asynq/pull/476) +### Changed +- Removed error log when `Scheduler` failed to enqueue a task. Use `PostEnqueueFunc` to check for errors and task actions if needed. +- Changed log level from ERROR to WARNINING when `Scheduler` failed to record `SchedulerEnqueueEvent`. + ## [0.23.0] - 2022-04-11 ### Added diff --git a/scheduler.go b/scheduler.go index f57c40d..afe9d13 100644 --- a/scheduler.go +++ b/scheduler.go @@ -147,7 +147,6 @@ func (j *enqueueJob) Run() { j.postEnqueueFunc(info, err) } if err != nil { - j.logger.Errorf("scheduler could not enqueue a task %+v: %v", j.task, err) if j.errHandler != nil { j.errHandler(j.task, j.opts, err) } @@ -160,7 +159,7 @@ func (j *enqueueJob) Run() { } err = j.rdb.RecordSchedulerEnqueueEvent(j.id.String(), event) if err != nil { - j.logger.Errorf("scheduler could not record enqueue event of enqueued task %+v: %v", j.task, err) + j.logger.Warnf("scheduler could not record enqueue event of enqueued task %s: %v", info.ID, err) } }