Skip to content

Commit

Permalink
Address code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Kukushkin committed Sep 2, 2016
1 parent 1891ffe commit da65f3f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions patroni/__init__.py
Expand Up @@ -84,6 +84,10 @@ def schedule_next_run(self):
nap_time = self.next_run - current_time
if nap_time <= 0:
self.next_run = current_time
# Release the GIL so we don't starve anyone waiting on async_executor lock
time.sleep(0.001)
# Warn user that Patroni is not keeping up
logger.warning("Loop time exceeded, rescheduling immediately.")
elif self.dcs.watch(nap_time):
self.next_run = time.time()

Expand Down

0 comments on commit da65f3f

Please sign in to comment.