Skip to content

Commit

Permalink
refactor: simplify wait_job method by removing unnecessary lines
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Jan 19, 2025
1 parent cffe6b2 commit ac6ff28
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/colony_print/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,13 @@ def get_job(self, id):
def wait_job(self, id, sleep=0.5, iterations=20):
for _ in range(iterations):
time.sleep(sleep)

try:
job = self.get_job(id)
except Exception:
continue

status = job.get("status", None)
if not status == "finished":
continue

if not "result" in job:
raise appier.OperationalError(message="No result found")
return job["result"]
Expand Down

0 comments on commit ac6ff28

Please sign in to comment.