def tokens_validation(self):
self.log.info('Validating tokens')
for token, enc_key in self.tokens.decrypt_keys_map().items():
self.log.info('Check token %s', token)
try:
user_info = Slacker(token).auth.test().body
SlackArchive.api_call_delay()
except Error as err:
self.mongo.db.z_errors.insert_one({'_id': time.time(),
'ctx': 'tokens_validation',
'msg': str(err)})
self.log.exception('Error %s for token %s', str(err), token)
del self.tokens[enc_key]
continue
self.log.info('Valid token')
self.tokens.upsert(token, user_info)
评论列表
文章目录