Skip to content

Commit

Permalink
Merge pull request #14 from cuda-networks/fix/python3-support
Browse files Browse the repository at this point in the history
Fix/python3 support
  • Loading branch information
itaybleier authored Aug 31, 2017
2 parents 80676ca + 5b65513 commit 20f5502
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions eb_sqs/worker/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,13 @@ def execute(self, msg):

def delay(self, group_id, queue_name, func, args, kwargs, max_retries, use_pickle, delay, execute_inline):
# type: (unicode, unicode, Any, tuple, dict, int, bool, int, bool) -> Any
id = unicode(uuid.uuid4())
worker_task = WorkerTask(id, group_id, queue_name, func, args, kwargs, max_retries, 0, None, use_pickle)
worker_task = WorkerTask(str(uuid.uuid4()), group_id, queue_name, func, args, kwargs, max_retries, 0, None, use_pickle)
return self._enqueue_task(worker_task, delay, execute_inline, False, True)

def retry(self, worker_task, delay, execute_inline, count_retries):
# type: (WorkerTask, int, bool, bool) -> Any
worker_task = worker_task.copy(settings.FORCE_SERIALIZATION)
worker_task.retry_id = unicode(uuid.uuid4())
worker_task.retry_id = str(uuid.uuid4())
return self._enqueue_task(worker_task, delay, execute_inline, True, count_retries)

def _enqueue_task(self, worker_task, delay, execute_inline, is_retry, count_retries):
Expand Down
4 changes: 2 additions & 2 deletions eb_sqs/worker/worker_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class WorkerTask(object):
def __init__(self, id, group_id, queue, func, args, kwargs, max_retries, retry, retry_id, use_pickle):
# type: (unicode, unicode, unicode, Any, tuple, dict, int, int, unicode, bool) -> None
# type: (str, unicode, unicode, Any, tuple, dict, int, int, unicode, bool) -> None
super(WorkerTask, self).__init__()
self.id = id
self.group_id = group_id
Expand All @@ -25,7 +25,7 @@ def __init__(self, id, group_id, queue, func, args, kwargs, max_retries, retry,
self.retry_id = retry_id
self.use_pickle = use_pickle

self.abs_func_name = '{}.{}'.format(self.func.__module__, self.func.func_name)
self.abs_func_name = '{}.{}'.format(self.func.__module__, self.func.__name__)

def execute(self):
# type: () -> Any
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='django-eb-sqs',
version='0.97',
version='0.98',
package_dir={'eb_sqs': 'eb_sqs'},
include_package_data=True,
packages=find_packages(),
Expand Down

0 comments on commit 20f5502

Please sign in to comment.