Merge pull request #284 from zalando/feature/reload_callbacks

Callbacks should be loaded not only on init.
This commit is contained in:
Oleksii Kliukin
2016-09-02 11:55:21 +02:00
committed by GitHub
+4 -1
View File
@@ -94,7 +94,6 @@ class Postgresql(object):
self._schedule_load_slots = self.use_slots
self._pgpass = config.get('pgpass') or os.path.join(os.path.expanduser('~'), 'pgpass')
self.callback = config.get('callbacks') or {}
self.__cb_called = False
config_base_name = config.get('config_base_name', 'postgresql')
self._postgresql_conf = os.path.join(self._data_dir, config_base_name + '.conf')
@@ -128,6 +127,10 @@ class Postgresql(object):
def use_slots(self):
return self._use_slots and self._major_version >= 9.4
@property
def callback(self):
return self.config.get('callbacks') or {}
def _version_file_exists(self):
return not self.data_directory_empty() and os.path.isfile(self._version_file)