monitor.py 文件源码

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

项目:arthur-redshift-etl 作者: harrystech 项目源码 文件源码
def start_server(self):
        """
        Start background daemon to serve our events.
        """
        handler_class = self.create_handler()

        class BackgroundServer(threading.Thread):
            def run(self):
                logger.info("Starting background server for monitor on port %d", MemoryStorage.SERVER_PORT)
                try:
                    httpd = _ThreadingSimpleServer((MemoryStorage.SERVER_HOST, MemoryStorage.SERVER_PORT),
                                                   handler_class)
                    httpd.serve_forever()
                except Exception as exc:
                    logger.info("Background server stopped: %s", str(exc))

        try:
            thread = BackgroundServer(daemon=True)
            thread.start()
        except RuntimeError:
            logger.warning("Failed to start monitor server:", exc_info=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号