lightster / hodor

🚪 A worker queue that is evolving to a job queue
MIT License
4 stars 1 forks source link

Only log job failure if error resulted in shutdown #213

Closed lightster closed 8 years ago

lightster commented 8 years ago

During shutdown the worker has been checking for error and attempting to mark the job as failed if there was an error. Sometimes an error occurs that does not result in the job being terminated early, such as an undefined variable. In that case, the job will already have been marked as successful, but the registered shutdown function has been also trying to mark it as a failure.

Instead of attempting to mark the job as a failure any time an error occurs, only mark the job as a failure if it has not already been acknowledged.