Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated to expose the retry parameter.

  • Loading branch information...
commit 82178e0388c302f89b7282ad1967d6b0d38cfe98 1 parent a308798
@paddyforan paddyforan authored
Showing with 8 additions and 5 deletions.
  1. +7 −4 iron_worker.py
  2. +1 −1  setup.py
View
11 iron_worker.py
@@ -221,7 +221,7 @@ def zip(self, destination=None, overwrite=True):
class IronWorker:
NAME = "iron_worker_python"
- VERSION = "1.1.0"
+ VERSION = "1.2.0"
def __init__(self, **kwargs):
"""Prepare a configured instance of the API wrapper and return it.
@@ -364,7 +364,7 @@ def tasks(self, scheduled=False):
tasks.append(Task(raw_task))
return tasks
- def queue(self, task=None, tasks=None, **kwargs):
+ def queue(self, task=None, tasks=None, retry=None, **kwargs):
tasks_data = []
if task is None:
task = Task(**kwargs)
@@ -405,8 +405,11 @@ def queue(self, task=None, tasks=None, **kwargs):
tasks_data.append(task_data)
data = json.dumps({type_str: tasks_data})
headers = {"Content-Type": "application/json"}
-
- resp = self.client.post(type_str, body=data, headers=headers)
+
+ if retry is not None:
+ resp = self.client.post(type_str, body=data, headers=headers, retry=retry)
+ else:
+ resp = self.client.post(type_str, body=data, headers=headers)
tasks = resp["body"]
if len(tasks[type_str]) > 1:
return [Task(task, scheduled=(type_str == "schedules"))
View
2  setup.py
@@ -4,7 +4,7 @@
name='iron-worker',
py_modules=["iron_worker"],
packages=["testDir"],
- version='1.1.0',
+ version='1.2.0',
install_requires=["iron_core", "python-dateutil"],
description='The Python client for IronWorker, a cloud service for background processing.',
author='Iron.io',
Please sign in to comment.
Something went wrong with that request. Please try again.