extension_manager.py 文件源码

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

项目:rock 作者: unitedstack 项目源码 文件源码
def report_status(self):
        current_thread_list = threading.enumerate()
        thread_name = []
        for thread in current_thread_list:
            if thread.name in self.extensions:
                thread_name.append(thread.name)
        LOG.info("Current plugin threads: " + " ".join(thread_name))

        # If some extensions threads exit unexpectedly, create a new thread
        # for it
        none_thread_extensions = [i for i in self.extensions
                                  if i not in thread_name]
        if len(none_thread_extensions) > 0:
            LOG.info("Recreating thread(s) for extension(s): " + " ".join(
                none_thread_extensions))
            for ext in none_thread_extensions:
                task = getattr(self.extensions[ext], 'periodic_task')
                task_name = ext
                t = threading.Thread(target=task, name=task_name)
                t.start()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号