pgoapi.py 文件源码

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

项目:pogom-linux 作者: PokeHunterProject 项目源码 文件源码
def _login(self, auth_provider, position):
        self.log.info('Attempting login: {}'.format(auth_provider.username))
        consecutive_fails = 0

        while not auth_provider.user_login():
            sleep_t = min(math.exp(consecutive_fails / 1.7), 5 * 60)
            self.log.info('Login failed, retrying in {:.2f} seconds'.format(sleep_t))
            consecutive_fails += 1
            time.sleep(sleep_t)
            if consecutive_fails == 5:
                raise AuthException('Login failed five times.')

        self.log.info('Login successful: {}'.format(auth_provider.username))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号