github_utils.py 文件源码

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

项目:t2-crash-reporter 作者: tessel 项目源码 文件源码
def new_comment_with_backoff(cls, crash_report):
        """
        there is a chance that this is a hot issue, and that there are too many crashes coming in.
        try and use backoff, when you are posting a new comment.
        """
        backoff_cache_key = cls.backoff_crash_key_new_comment(crash_report)
        backoff_value = memcache.get(backoff_cache_key)
        if not backoff_value:
            # A task does not exist. Queue a job.
            memcache.set(backoff_cache_key, "in_progress")
            deferred.defer(
                GithubOrchestrator.add_comment_job,
                crash_report.fingerprint, _queue=GithubOrchestrator.__QUEUE__)
            logging.info(
                'Enqueued job for new comment on GitHub for fingerprint {0}'.format(crash_report.fingerprint))
        else:
            # task already in progress, backoff
            logging.info(
                'A GitHub task is already in progress. Waiting to the dust to settle for fingerprint {0}'
                    .format(crash_report.fingerprint)
            )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号