wsgi.py 文件源码

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

项目:bilean 作者: openstack 项目源码 文件源码
def reload(self):
        """Reload and re-apply configuration settings.

        Existing child processes are sent a SIGHUP signal and will exit after
        completing existing requests. New child processes, which will have the
        updated configuration, are spawned. This allows preventing
        interruption to the service.
        """
        def _has_changed(old, new, param):
            old = old.get(param)
            new = getattr(new, param)
            return (new != old)

        old_conf = self.stash_conf_values()
        has_changed = functools.partial(_has_changed, old_conf, self.conf)
        cfg.CONF.reload_config_files()
        os.killpg(self.pgid, signal.SIGHUP)
        self.stale_children = self.children
        self.children = set()

        # Ensure any logging config changes are picked up
        logging.setup(cfg.CONF, self.name)

        self.configure_socket(old_conf, has_changed)
        self.start_wsgi()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号