-
Notifications
You must be signed in to change notification settings - Fork 37
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
Designate a queue for running the pipeline tasks #346
Changes from all commits
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 |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
from django.contrib.sites.models import Site | ||
from django.utils.timezone import utc | ||
|
||
from celery import chord | ||
from celery import chord, group | ||
from celery.app import shared_task | ||
from celery.utils.log import get_task_logger | ||
|
||
|
@@ -393,5 +393,5 @@ def run_figures_monthly_metrics(): | |
return | ||
|
||
logger.info('Starting figures.tasks.run_figures_monthly_metrics...') | ||
for site in get_sites(): | ||
populate_monthly_metrics_for_site.delay(site_id=site.id) | ||
all_sites_jobs = group(populate_monthly_metrics_for_site.s(site.id) for site in get_sites()) | ||
all_sites_jobs.delay() | ||
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. @melvinsoft These two lines I'm really interested to know if they will work. I had tried doing grouping before in early Figures development, but the tasks seemed to have not been executed or died silently 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. @johnbaldwin We definitely need to try it out on staging, but I pushed the branch directly on Staging and run the Django management command and I was able to generate data. I'm not sure how did you tried in the past, but if you look at the first line added, I'm creating a group of signatures. So it's Tasks -> Signature -> Group. We've a design problem that I'm trying to solve with group, we've a celery task 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.
Interesting find! Let's try it and see if it works. |
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.
What does this variable mean?