Permalink
Browse files

uses GET when no params provided

  • Loading branch information...
1 parent 4c29cdb commit 47d3800a0e5ea1ac63841eae0a1ca0f33950d18b @thruflo committed Feb 7, 2010
Showing with 21 additions and 12 deletions.
  1. +11 −2 CHANGES.rst
  2. +1 −1 setup.py
  3. +1 −0 src/torque/processor.py
  4. +8 −9 src/torque/webapp.py
View
@@ -1,9 +1,18 @@
+0.4.5
+-----
+
+* if you don't provide any ``params`` when creating the task,
+ ``ConcurrentExecuter`` makes a ``GET`` request when executing it
+
+
0.4.3
-----
-* enabled processing in a thread, via the ``async=True|False`` option to ``QueueProcessor.start`` method
-* provided ``./bin/torque-run`` to run the webapp and processor in seperate threads of a single OS process
+* enabled processing in a thread, via the ``async=True|False`` option
+ to ``QueueProcessor.start`` method
+* provided ``./bin/torque-run`` to run the webapp and processor in
+ seperate threads of a single OS process
0.4.2
View
@@ -2,7 +2,7 @@
setup(
name = 'torque',
- version = '0.4.4',
+ version = '0.4.5',
description = 'A web hook task queue based on tornado and redis',
long_description = open('README.rst').read(),
author = 'James Arthur',
View
@@ -218,6 +218,7 @@ def _run(self):
backoff = backoff * self.error_multiplier
if backoff > self.max_error_delay:
backoff = self.max_error_delay
+ logging.info('backing off from error for %s seconds' % backoff)
time.sleep(backoff)
View
@@ -120,15 +120,14 @@ def post(self):
self.status_codes = {}
http = httpclient.AsyncHTTPClient(max_clients=len_tasks)
for task in tasks:
- http.fetch(
- task.url,
- method='POST',
- body=unicode_urlencode(task.params),
- callback=self.async_callback(
- self._handle_response,
- task_id = task.id
- )
- )
+ callback = self.async_callback(self._handle_response, task_id=task.id)
+ kwargs = {}
+ if task.params:
+ kwargs = {
+ 'method': 'POST',
+ 'body': unicode_urlencode(task.params)
+ }
+ http.fetch(task.url, callback=callback, **kwargs)
self.task_ids.append(task.id)

0 comments on commit 47d3800

Please sign in to comment.