Skip to content

Patch for issue #41#42

Open
dalgard wants to merge 4 commits into
meteor:masterfrom
dalgard:master
Open

Patch for issue #41#42
dalgard wants to merge 4 commits into
meteor:masterfrom
dalgard:master

Conversation

@dalgard

@dalgard dalgard commented Feb 23, 2015

Copy link
Copy Markdown

#41

@zol

zol commented Feb 23, 2015

Copy link
Copy Markdown
Contributor

Thanks for you patch @dalgard . Before I'm able to merge it, could you please add some tests around it?

@dalgard

dalgard commented Feb 23, 2015

Copy link
Copy Markdown
Author

Can you see my two latest commits under this pull request?

I don't know how to write the code around the call to SyncedCron.add inside the Tinytests. This is as good as I can make it. Also added documentation. Thanks :)

@zol

zol commented Feb 23, 2015

Copy link
Copy Markdown
Contributor

You could take a look at synced-cron-tests.js for inspiration. It will take me some time to get around to writing tests against this PR. We have a policy of not merging untested code into our packages.

@dalgard

dalgard commented Mar 16, 2015

Copy link
Copy Markdown
Author

Sorry for the late reply. It's a sound attitude, but this library doesn't have the greatest test coverage to begin with and the change is very little – I don't know how to write Tinytests, but with my scaffolding, it will take you very little time.

At any rate, I'm using the patch in production – I really think you should consider it :) Thanks!

…nced-cron

Conflicts:
	synced-cron-server.js
	synced-cron-tests.js
@tylerstraub

Copy link
Copy Markdown

In attempting to use the parser.cron method with this forked version, I am experiencing recursive calls during the execution stage of a scheduled job.

With a CRON syntax input such as "58 13 30 4 ? 2015", I am experiencing these results:

SyncedCron.add({
  name: 'Crunch some important numbers for the marketing department',
  schedule: function(parser) {
    // parser is a later.parse object
    return parser.cron('58 13 30 4 ? 2015');
  },
  job: function() {

 /* Anything placed here is firing recursively */

  }
});

What methods for parsing the later.js object have you been successful with in your fork @dalgard?

Thanks!

@dalgard

dalgard commented May 5, 2015

Copy link
Copy Markdown
Author

I don't really know the cron syntax, I'm using this line in my application:

// Non-recurring
return parser.recur().on(ending_at).fullDate();

@StorytellerCZ StorytellerCZ linked an issue Sep 28, 2023 that may be closed by this pull request
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 servers can still run the same job at the same time

4 participants