-
Notifications
You must be signed in to change notification settings - Fork 18
Use central job enqueue logic for jobs spawned by rules #962
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
Changes from 3 commits
8172811
12d700e
ceb735f
17f9f82
732d8bc
c6aef26
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
|
|
||
| from . import gears | ||
| from .jobs import Job | ||
| from .queue import Queue | ||
|
|
||
| log = config.log | ||
|
|
||
|
|
@@ -237,9 +238,10 @@ def create_jobs(db, container_before, container_after, container_type): | |
| spawned_jobs = [] | ||
|
|
||
| for pj in potential_jobs: | ||
| pj['job'].insert() | ||
| spawned_jobs.append(pj['rule']['alg']) | ||
| job_map = pj['job'].map() | ||
| Queue.enqueue_job(job_map, None) # passing no origin results in system origin | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given this usage, what would your opinion be of making
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is more important we set and origin when we can, this is the only situation I am aware of that does not set an origin. I worry if the origin is optional, it will not be set when it should.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of band: the |
||
|
|
||
| spawned_jobs.append(pj['rule']['alg']) | ||
|
|
||
| return spawned_jobs | ||
|
|
||
|
|
||
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.
Can you explain the rationale behind this change? This would fail if
c['config']is None.Uh oh!
There was an error while loading. Please reload this page.
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.
It was failing when the config key existed but was not set. AKA, it was the "new" style, but there was no config for the job. There were inputs and destination.
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.
Out-of-band: Given that this is a database anti-upgrade hackaround, let's just run with this for now 👍