Skip to content

Commit

Permalink
Bug 1153186 - Rename the submit_star_comment & submit_bug_comment tasks
Browse files Browse the repository at this point in the history
s/submit_star_comment/submit_elasticsearch_doc/
s/submit-star-comment/submit-elasticsearch-doc/
s/submit_bug_comment/submit_bugzilla_comment/
s/submit-bug-comment/submit-bugzilla-comment/
  • Loading branch information
Ed Morley committed Apr 13, 2015
1 parent c8daf2d commit 10b6e1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions treeherder/etl/tasks/classification_mirroring_tasks.py
Expand Up @@ -6,8 +6,8 @@
from treeherder.etl.classification_mirroring import ElasticsearchDocRequest, BugzillaCommentRequest


@task(name="submit-star-comment", max_retries=10, time_limit=30)
def submit_star_comment(project, job_id, bug_id, submit_timestamp, who):
@task(name="submit-elasticsearch-doc", max_retries=10, time_limit=30)
def submit_elasticsearch_doc(project, job_id, bug_id, submit_timestamp, who):
"""
Mirror the classification to Elasticsearch using a post request, until
OrangeFactor is rewritten to use Treeherder's API directly.
Expand All @@ -19,14 +19,14 @@ def submit_star_comment(project, job_id, bug_id, submit_timestamp, who):
except Exception as e:
# Initially retry after 1 minute, then for each subsequent retry
# lengthen the retry time by another minute.
submit_star_comment.retry(exc=e, countdown=(1 + submit_star_comment.request.retries) * 60)
submit_elasticsearch_doc.retry(exc=e, countdown=(1 + submit_elasticsearch_doc.request.retries) * 60)
# this exception will be raised once the number of retries
# exceeds max_retries
raise


@task(name="submit-bug-comment", max_retries=10, time_limit=30)
def submit_bug_comment(project, job_id, bug_id, who):
@task(name="submit-bugzilla-comment", max_retries=10, time_limit=30)
def submit_bugzilla_comment(project, job_id, bug_id, who):
"""
Send a post request to Bugzilla's REST API to add a new comment to the associated bug.
In the future this will be removed in favour of periodic (eg once a week) summary comments
Expand All @@ -39,7 +39,7 @@ def submit_bug_comment(project, job_id, bug_id, who):
except Exception as e:
# Initially retry after 1 minute, then for each subsequent retry
# lengthen the retry time by another minute.
submit_bug_comment.retry(exc=e, countdown=(1 + submit_bug_comment.request.retries) * 60)
submit_bugzilla_comment.retry(exc=e, countdown=(1 + submit_bugzilla_comment.request.retries) * 60)
# this exception will be raised once the number of retries
# exceeds max_retries
raise
8 changes: 4 additions & 4 deletions treeherder/model/derived/jobs.py
Expand Up @@ -667,10 +667,10 @@ def insert_bug_job_map(self, job_id, bug_id, assignment_type, submit_timestamp,
job = self.get_job(job_id)[0]
if job["state"] == "completed":
# importing here to avoid an import loop
from treeherder.etl.tasks import (submit_star_comment,
submit_bug_comment)
from treeherder.etl.tasks import (submit_elasticsearch_doc,
submit_bugzilla_comment)
# Submit bug associations to Bugzilla/Elasticsearch using async tasks.
submit_star_comment.apply_async(
submit_elasticsearch_doc.apply_async(
args=[
self.project,
job_id,
Expand All @@ -680,7 +680,7 @@ def insert_bug_job_map(self, job_id, bug_id, assignment_type, submit_timestamp,
],
routing_key='high_priority'
)
submit_bug_comment.apply_async(
submit_bugzilla_comment.apply_async(
args=[
self.project,
job_id,
Expand Down

0 comments on commit 10b6e1b

Please sign in to comment.