Skip to content

Commit

Permalink
Bug 1281463 - Remove unnecessary second JobLog fetch
Browse files Browse the repository at this point in the history
Since it's already fetched as part of the `parser_task` decorator.
  • Loading branch information
Ed Morley committed Jun 22, 2016
1 parent 8d43e3c commit 8c211be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion treeherder/log_parser/tasks.py
Expand Up @@ -104,7 +104,7 @@ def parse_log(project, job_guid, job_log, _priority):
"""
post_log_artifacts(project,
job_guid,
job_log.url,
job_log,
parse_log)


Expand Down
10 changes: 4 additions & 6 deletions treeherder/log_parser/utils.py
Expand Up @@ -37,7 +37,7 @@ def extract_text_log_artifacts(project, log_url, job_guid):

def post_log_artifacts(project,
job_guid,
job_log_url,
job_log,
retry_task):
"""Post a list of artifacts to a job."""
def _retry(e):
Expand All @@ -47,12 +47,10 @@ def _retry(e):
# .retry() raises a RetryTaskError exception,
# so nothing after this function will be executed

log_description = "%s %s (%s)" % (project, job_guid, job_log_url)
log_url = job_log.url
log_description = "%s %s (%s)" % (project, job_guid, log_url)
logger.debug("Downloading/parsing log for %s", log_description)

job_log = JobLog.objects.get(job__guid=job_guid,
url=job_log_url)

credentials = Credentials.objects.get(client_id=settings.ETL_CLIENT_ID)
client = TreeherderClient(
protocol=settings.TREEHERDER_REQUEST_PROTOCOL,
Expand All @@ -62,7 +60,7 @@ def _retry(e):
)

try:
artifact_list = extract_text_log_artifacts(project, job_log_url, job_guid)
artifact_list = extract_text_log_artifacts(project, log_url, job_guid)
except Exception as e:
job_log.update_status(JobLog.FAILED)

Expand Down

0 comments on commit 8c211be

Please sign in to comment.