github_utils.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:t2-crash-reporter 作者: tessel 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号