github.py 文件源码

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

项目:jenkins-epo 作者: peopledoc 项目源码 文件源码
def wait_rate_limit_reset(now):
    reset = (
        datetime.utcfromtimestamp(GITHUB.x_ratelimit_reset)
        .replace(tzinfo=timezone.utc)
    )
    delta = reset - now
    wait = delta.total_seconds() + .5
    if wait < 1 or 3500 < wait:
        # Our data is outdated. Just go on.
        return 0

    logger.warning("Waiting rate limit reset in %s seconds.", wait)
    time.sleep(wait)
    GITHUB._instance.x_ratelimit_remaining = -1
    return wait
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号