mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Reload REST API certificate only on SIGHUP (#2004)
And make sure that cert number is cached when the RestApiServer object is created. Close https://github.com/zalando/patroni/issues/2003
This commit is contained in:
+1
-1
@@ -74,7 +74,7 @@ class Patroni(AbstractPatroniDaemon):
|
||||
if local:
|
||||
self.tags = self.get_tags()
|
||||
self.request.reload_config(self.config)
|
||||
if local or self.api.reload_local_certificate():
|
||||
if local or sighup and self.api.reload_local_certificate():
|
||||
self.api.reload_config(self.config['restapi'])
|
||||
self.watchdog.reload_config(self.config)
|
||||
self.postgresql.reload_config(self.config['postgresql'], sighup)
|
||||
|
||||
+2
-2
@@ -646,10 +646,10 @@ class RestApiServer(ThreadingMixIn, HTTPServer, Thread):
|
||||
self.patroni = patroni
|
||||
self.__listen = None
|
||||
self.__ssl_options = None
|
||||
self.reload_config(config)
|
||||
self.daemon = True
|
||||
self.__ssl_serial_number = None
|
||||
self._received_new_cert = False
|
||||
self.reload_config(config)
|
||||
self.daemon = True
|
||||
|
||||
def query(self, sql, *params):
|
||||
cursor = None
|
||||
|
||||
Reference in New Issue
Block a user