miaowing / nest-schedule

A cron-like and not-cron-like job distributed scheduler for Nest.js by decorators.
MIT License
432 stars 35 forks source link

UnhandledPromiseRejectionWarning: #<JobRepeatException> is thrown when apply HRM #32

Open 6thpath opened 4 years ago

6thpath commented 4 years ago

Nest throw this error when HRM is active

(node:11295) UnhandledPromiseRejectionWarning: #<JobRepeatException>
(node:11295) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 7)

Please help!

coldiary commented 4 years ago

I had the same exception thrown, I didn't look at the internals but giving a unique key to cron decorators prevent the exception to be thrown in my case :

@Cron('* 12 * * *', { key: 'some-unique-identifier' })
scheduledMethod() {
    // ...
}