Skip to content

Commit

Permalink
Added check for timeout when scheduled=True
Browse files Browse the repository at this point in the history
  • Loading branch information
terrhorn committed Aug 3, 2015
1 parent bed0bb1 commit 390eab9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions iron_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ def queue(self, task=None, tasks=None, retry=None, **kwargs):
task.start_at = task.start_at.replace(tzinfo=tzlocal())
task_data["start_at"] = iron_core.IronClient.toRfc3339(
task.start_at)
if task.timeout is not None:
task_data["timeout"] = task.timeout
task_data["label"] = task.label
task_data["cluster"] = task.cluster
tasks_data.append(task_data)
Expand Down
2 changes: 1 addition & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_postAdvancedSchedule(self):
resp = self.worker.queue(
code_name=self.code_name,
payload={"schedule": "AWESOME SCHEDULE!"},
start_at=start_at, run_every=3600, run_times=8)
start_at=start_at, run_every=3600, run_times=8, timeout=120)

schedules = self.worker.tasks(scheduled=True)
schedule_ids = []
Expand Down

0 comments on commit 390eab9

Please sign in to comment.