Closed jspc closed 6 months ago
I see your point. Generally, middleware is not meant to disrupt the flow of the job/task but only intercept it. An error in a middleware is considered an error in the middleware itself -- not with the job/task itself.
But that being said, you can write a task middleware that sends the the task to the error
queue to fail the job.
@jspc thoughts? https://github.com/runabol/tork/pull/424
Consider the
job.HandlerFunc
When this gets called the logs, as expected, show
ERR unexpcted error occurred while processing task error="some error"
, however the status of the Job remains asPENDING
, where I'd expect it to beFAILED
.I've tried to manually update the job to set the expected state, but this seems to be ignored.
Is this a bug, or am I doing something wrong?