bot_manager.py 文件源码

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

项目:django-botmanager 作者: dimoha 项目源码 文件源码
def run(self):
        setproctitle(self.process_name)
        while True:
            try:

                if os.getppid() != self.parent_pid:
                    logging.info(u"Parent process is die. Exit..")
                    break

                task = self.queue.get_nowait()
                try:
                    self.run_task(task)
                except Exception as e:
                    logging.exception(u"Worker {0} catch exception on task {1}: {2}".format(
                        self, task.id, e
                    ))
                finally:
                    pass
            except QueueEmpty:
                sleep(1)
            except Exception as e:
                logging.exception(
                    u"Error in queue preparing: %s".format(e)
                )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号