From 6c4b9977fb6416305c4f8671deee1e7036697b51 Mon Sep 17 00:00:00 2001 From: Jason Pell Date: Wed, 24 Mar 2021 11:54:34 +1100 Subject: [PATCH] fix issue with a sighup config reload, not working for base backups --- pghoard/pghoard.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pghoard/pghoard.py b/pghoard/pghoard.py index 631ae856..2f004af1 100644 --- a/pghoard/pghoard.py +++ b/pghoard/pghoard.py @@ -705,7 +705,10 @@ def load_config(self, _signal=None, _frame=None): # pylint: disable=unused-argu raise raise InvalidConfigurationError(self.config_path) + # clear this objects site transfer storage config + self.site_transfers = {} self.config = new_config + if self.config.get("syslog") and not self.syslog_handler: self.syslog_handler = logutil.set_syslog_handler( address=self.config.get("syslog_address", "/dev/log"), @@ -726,6 +729,10 @@ def load_config(self, _signal=None, _frame=None): # pylint: disable=unused-argu prometheus=self.config.get("prometheus", None) ) + # need to refresh the web server config too + if hasattr(self, "webserver") and hasattr(self.webserver, "server"): + self.webserver.server.config = new_config + for thread in self._get_all_threads(): thread.config = new_config thread.site_transfers = {}