diff --git a/patroni.py b/patroni.py index e26a4059..97d34ca2 100755 --- a/patroni.py +++ b/patroni.py @@ -76,7 +76,7 @@ class Patroni: if nap_time <= 0: self.next_run = current_time else: - self.ha.dcs.sleep(nap_time) + self.ha.dcs.watch(nap_time) def run(self): self.api.start() diff --git a/tests/test_patroni.py b/tests/test_patroni.py index c0ea2907..489c4fa6 100644 --- a/tests/test_patroni.py +++ b/tests/test_patroni.py @@ -104,7 +104,7 @@ class TestPatroni(unittest.TestCase): self.p.touch_member = self.touch_member self.p.ha.state_handler.sync_replication_slots = time_sleep self.p.ha.dcs.client.read = etcd_read - self.p.ha.dcs.sleep = time_sleep + self.p.ha.dcs.watch = time_sleep self.assertRaises(SleepException, self.p.run) self.p.ha.state_handler.is_leader = lambda: False self.p.api.start = nop