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

Scheduling jobs in the past #157

Closed
santigimeno opened this issue Jun 7, 2015 · 4 comments
Closed

Scheduling jobs in the past #157

santigimeno opened this issue Jun 7, 2015 · 4 comments
Labels

Comments

@santigimeno
Copy link
Member

Before releasing 1.0.0 I would like to discuss if we should change the behavior when scheduling jobs in the past. The current behavior is that the job gets executed immediately.

My position is that we should not allow scheduling a job in the past, and that if somebody wants to execute something immediately, should just execute the task right away, without using node-schedule.

@davisford raised some valid points for keeping the functionality as it is. See: #151 for the discussion

cc/ @tejasmanohar @jonhester

@tejasmanohar
Copy link
Member

Yeah, I don't like the idea of allowing jobs to be scheduled in the past. that could be prevented in the validation similar to the one we have a // TODO in the code right now for (see #108 but this one also for date-based scheduling).

santigimeno referenced this issue in santigimeno/node-schedule Aug 31, 2015
- Uncomment disabled 'past' tests that now pass again.
@tejasmanohar
Copy link
Member

Hm, I'm thinking of adding this back and releasing a major version change (semver). Thoughts, @santigimeno? I don't see a legitimate reason for node-schedule to run something immediately, even for tests- sounds like that should be handled with Date manipulation, sinon fake timers, or just testing the actual function that's being run by a job rather than the job scheduling itself.

@santigimeno
Copy link
Member Author

@tejasmanohar I tend to agree with you. I just hope it doesn't break many applications, but probably the only way to know is having a new release out and wait for bug reports.

BTW what are your plans for this major release. I think you should open an issue to discuss what should be in form the dev branch.

@santigimeno
Copy link
Member Author

Version 1.0.0 disallows for scheduling jobs in the past

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

No branches or pull requests

2 participants