Skip to content

Commit

Permalink
Bug 1242776 - stop adding tasks to autoclassify queue
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Dawson committed Jan 25, 2016
1 parent e460f9f commit 2843ebd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions treeherder/config/settings.py
Expand Up @@ -331,6 +331,9 @@
MIRROR_CLASSIFICATIONS = True
ES_HOST = "http://of-elasticsearch-zlb.webapp.scl3.mozilla.com:9200"

# Enable integration between autoclassifier and jobs
AUTOCLASSIFY_JOBS = env.bool("AUTOCLASSIFY_JOBS", default=False)

# timeout for requests to external sources
# like ftp.mozilla.org or hg.mozilla.org
REQUESTS_TIMEOUT = 30
Expand Down
8 changes: 5 additions & 3 deletions treeherder/log_parser/tasks.py
@@ -1,6 +1,7 @@
import logging

from celery import task
from django.conf import settings
from django.core.management import call_command

from treeherder import celery_app
Expand Down Expand Up @@ -59,8 +60,9 @@ def store_error_summary(project, job_log_url, job_guid):
try:
logger.info('Running store_error_summary')
call_command('store_error_summary', job_log_url, job_guid, project)
celery_app.send_task('autoclassify',
[project, job_guid],
routing_key='autoclassify')
if settings.AUTOCLASSIFY_JOBS:
celery_app.send_task('autoclassify',
[project, job_guid],
routing_key='autoclassify')
except Exception, e:
store_error_summary.retry(exc=e, countdown=(1 + store_error_summary.request.retries) * 60)

0 comments on commit 2843ebd

Please sign in to comment.