The real-world scenario where this occurs is: creating a job with a longish Epsilon, running once and failing, then rebooting the service. Panic will occur on startup when the cache is re-loading the jobs from the db and starts firing them off.
The root cause is not calling InitDelayDuration() on jobs when retrieving them from the database. If this isn't done, any job with an Epsilon will cause this panic.
From reading the source, these storage drivers call InitDelayDuration() correctly:
The following test will produce a panic in the Postgres and Mongo storage methods:
The panic will look like:
The real-world scenario where this occurs is: creating a job with a longish Epsilon, running once and failing, then rebooting the service. Panic will occur on startup when the cache is re-loading the jobs from the db and starts firing them off.
The root cause is not calling
InitDelayDuration()
on jobs when retrieving them from the database. If this isn't done, any job with anEpsilon
will cause this panic.From reading the source, these storage drivers call
InitDelayDuration()
correctly:These do not: