common.py 文件源码

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

项目:itchatmp 作者: littlecodersh 项目源码 文件源码
def maintain_thread(self, firstCallResult=None):
        ''' thread to update token and
        register next update event into event loop '''
        r = firstCallResult or self._syncTokenFunction()
        if not r:
            self.core.ioLoop.call_later(
                (datetime.replace(datetime.now() + timedelta(days=1), 
                hour=0, minute=5, second=0) - datetime.now()).seconds,
                self.maintain_access_token, None)
        else:
            self.core.ioLoop.call_later(r['expires_in'] - 30,
                self.maintain_access_token, None)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号