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

feat: run a scheduler only once at startup #33

Merged
merged 2 commits into from
Nov 16, 2017
Merged

feat: run a scheduler only once at startup #33

merged 2 commits into from
Nov 16, 2017

Conversation

zhennann
Copy link
Contributor

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@codecov-io
Copy link

codecov-io commented Nov 15, 2017

Codecov Report

Merging #33 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #33   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           9      9           
  Lines         167    167           
=====================================
  Hits          167    167
Impacted Files Coverage Δ
lib/timer.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83fd40a...fbeab9d. Read the comment docs.

@zhennann
Copy link
Contributor Author

@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) {
Copy link
Member

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')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, it's well.

@atian25
Copy link
Member

atian25 commented Nov 16, 2017

@atian25 Why "continuous-integration/appveyor/branch" always not passed, something wrong?

maybe it's permission problem, forgot it.

Copy link
Member

@atian25 atian25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@atian25 atian25 merged commit 69a588e into eggjs:master Nov 16, 2017
@atian25
Copy link
Member

atian25 commented Nov 16, 2017

3.1.0

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

Successfully merging this pull request may close these issues.

3 participants