Closed Rukeith closed 6 years ago
Try removing your startIn option on publish. You’re delaying the job.
@timgit Couldn't I fetch the delay job?
the startIn option means, “do not make this job available to anyone until an interval of time has elapsed”. What is your use case?
@timgit My case is I will publish a job with some conditions. When the same condition of job publish again. I want to cancel the previous job which was setting the startIn to delayed.
Ok, well I'm not in a position to know what's best for this use case, but one thing you could try is calling cancel(id)
to cancel the previous job. You could also take a look at the throttling options if that fits what you're trying to do.
Here is my demo below. I use
boss.fetch
but that return null.