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

Add feature to respect dependency #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rontendo-jp
Copy link

rq-scheduler should respect the depends_on parameter like in RQ.

Job B which depends on Job A should not run if Job A has not finished.

DETAIL:
A simplified use case, there are two jobs: Job A, and Job B. Job B should not run before Job A is done.
In an environment where there are more than one rqworker running, without this code change, rq-scheduler doesn't respect job dependency. Meaning that, since there are multiple rqworkers running, Job B and Job A could run in parallel.

SIMPLE TEST:
I created like the below, and confirmed that job2 did not get picked up by the second rqworker if job1 has not finished.
job1 = s.schedule(scheduled_time=START_TIME, func=count, interval=SCRIPT_INTERVAL, repeat=1)
job2 = s.schedule(scheduled_time=START_TIME, func=say_hello, depends_on=job1)

If you like this PR, I can update the README.md afterwards. Thx!

rq-scheduler should respect the depends_on parameter like in RQ.

Job B which depends on Job A should not run if Job A has not finished.

Signed-off-by: pacifictoy <[email protected]>
@selwin
Copy link
Contributor

selwin commented Oct 25, 2014

Thanks for the PR. Could please add a test for this feature?

@noncomputable noncomputable mentioned this pull request Feb 18, 2020
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 participants