Permalink
Browse files

Correct sleep so it happens before loop

  • Loading branch information...
1 parent c8408a1 commit 50b7791e5e494c0fd5b3274772b51a9d84b6fbd4 @dcramer committed May 15, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 setup.py
  2. +2 −2 src/taskmaster/controller.py
View
@@ -5,7 +5,7 @@
setup(
name="taskmaster",
license='Apache License 2.0',
- version="0.4.2",
+ version="0.4.3",
description="",
author="David Cramer",
author_email="dcramer@gmail.com",
@@ -80,6 +80,8 @@ def state_writer(self):
last_job_id = None
with open(self.state_file, 'w') as fp:
while self.server.is_alive():
+ gevent.sleep(0)
+
try:
job_id, job = self.server.first_job()
except IndexError:
@@ -92,8 +94,6 @@ def state_writer(self):
last_job_id = job_id
- gevent.sleep(0)
-
def reset(self):
if path.exists(self.state_file):
unlink(self.state_file)

0 comments on commit 50b7791

Please sign in to comment.