I'm using a function to create jobs. When creating them like this, I have no problems at all:
startPurgeOldJobsJob: function() {
console.log('startPurgeOldJobsJob');
// creates job with no data:
let job = new Job(
jobsCollection,
JOB_TYPES.PURGE_OLD_JOBS,
{}
);
// sets repeating schedule:
job.repeat({
schedule: jobsCollection.later.parse.text('on the first day at 1:00')
});
// set retry options in case of failure:
job.retry({
retries: 5,
wait: 10*60*1000,
backoff: 'exponential'
});
// saves job cancelling other jobs generated for repetitions:
job.save({cancelRepeats: true});
// returns generated job:
return job;
}
However, when I remove the {cancelRepeats: true} options in the .save(), I start getting this errors about UnhandledPromiseRejectionWarning like this:
(STDERR) (node:60748) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): RangeError: Maximum call stack size exceeded
(STDERR) (node:60748) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Hi,
I'm using a function to create jobs. When creating them like this, I have no problems at all:
However, when I remove the
{cancelRepeats: true}
options in the.save()
, I start getting this errors aboutUnhandledPromiseRejectionWarning
like this:Any ideas on this issue?