I'm not sure this should be the responsibility of the worker. I think the worker should be a simple as possible and this sort of monitoring should be done elsewhere in the system. At any rate, I don't think the queue should care that the job was 'failed' rather than 'cancelled'.