def create_issue_job(cls, fingerprint):
"""
Handles the create issue job.
"""
crash_report = None
try:
github_client = GithubClient()
crash_report = CrashReport.get_crash(fingerprint)
if crash_report is not None:
# create the github issue
issue = github_client.create_issue(crash_report)
logging.info(
'Created GitHub Issue No({0}) for crash ({1})'.format(issue.number, crash_report.fingerprint))
# update the crash report with the issue id
updated_report = CrashReports.update_crash_report(crash_report.fingerprint, {
# convert to unicode string
'issue': str(issue.number)
})
logging.info(
'Updating crash report with fingerprint ({0}) complete.'.format(updated_report.fingerprint))
except Exception, e:
logging.error('Error creating issue for fingerprint ({0}) [{1}]'.format(fingerprint, str(e)))
finally:
# remove the backoff cache key, so future jobs may be enqueued
backoff_cache_key = cls.backoff_crash_key_new_crash(crash_report)
memcache.delete(backoff_cache_key)
评论列表
文章目录