Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnhandledPromiseRejectionWarning when creating jobs #272

Open
luixal opened this issue Dec 12, 2018 · 0 comments
Open

UnhandledPromiseRejectionWarning when creating jobs #272

luixal opened this issue Dec 12, 2018 · 0 comments

Comments

@luixal
Copy link

luixal commented Dec 12, 2018

Hi,

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.

Any ideas on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant