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)
)
评论列表
文章目录