Reload server configuration.
(self)
| 260 | self._test_connection(timeout=wait) |
| 261 | |
| 262 | def reload(self): |
| 263 | """Reload server configuration.""" |
| 264 | status = self.get_status() |
| 265 | if status != 'running': |
| 266 | raise ClusterError('cannot reload: cluster is not running') |
| 267 | |
| 268 | process = subprocess.run( |
| 269 | [self._pg_ctl, 'reload', '-D', self._data_dir], |
| 270 | stdout=subprocess.PIPE, |
| 271 | stderr=subprocess.PIPE, |
| 272 | cwd=self._data_dir, |
| 273 | ) |
| 274 | |
| 275 | stderr = process.stderr |
| 276 | |
| 277 | if process.returncode != 0: |
| 278 | raise ClusterError( |
| 279 | 'pg_ctl stop exited with status {:d}: {}'.format( |
| 280 | process.returncode, stderr.decode())) |
| 281 | |
| 282 | def stop(self, wait=60): |
| 283 | process = subprocess.run( |