def posts_fetcher(self):
while True:
for bot in self.bots:
try:
if settings.DEBUG:
print('Checking for news {} on bot type {}-{}'.format(datetime.datetime.utcnow(), bot.web_type,
bot.target_url))
chat_id = bot.chat_id or self.chat
posts = bot.save_last_updates(chat_id)
if settings.DEBUG:
print('-- {} New posts saved found'.format(len(posts)))
except Exception as e:
exc_type, exc_value, exc_traceback = sys.exc_info()
error_stack = 'Save_updates ERROR: {}\n'.format(e)
error_stack += "".join(traceback.format_exception(exc_type, exc_value, exc_traceback))
self.send_error(error_stack)
gevent.sleep(self.wait_seconds)
telegram_writer.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录