-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: run a scheduler only once at startup #33
Conversation
Codecov Report
@@ Coverage Diff @@
## master #33 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 9 9
Lines 167 167
=====================================
Hits 167 167
Continue to review full report at Codecov.
|
@atian25 Why "continuous-integration/appveyor/branch" always not passed, something wrong? |
lib/timer.js
Outdated
@@ -19,8 +19,8 @@ class Timer { | |||
*/ | |||
handler(key, schedule, listener) { | |||
const { interval, cron, cronOptions, immediate } = schedule; | |||
if (!interval && !cron) { | |||
throw new Error('[egg-schedule] schedule.interval or schedule.cron must be present'); | |||
if (!interval && !cron && !immediate) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had another idea, we should change this check to assert
.
assert(interval || cron || immediate, '[egg-schedule] schedule.interval or schedule.cron or schedule.immediate must be present')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, it's well.
maybe it's permission problem, forgot it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
3.1.0 |
Checklist
npm test
passes