p1-taskqueue 0.1.5__tar.gz → 0.1.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of p1-taskqueue might be problematic. Click here for more details.
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/PKG-INFO +1 -1
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/pyproject.toml +1 -1
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/src/p1_taskqueue.egg-info/PKG-INFO +1 -1
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/src/taskqueue/cmanager.py +8 -6
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/README.md +0 -0
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/setup.cfg +0 -0
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/src/p1_taskqueue.egg-info/SOURCES.txt +0 -0
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/src/p1_taskqueue.egg-info/dependency_links.txt +0 -0
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/src/p1_taskqueue.egg-info/requires.txt +0 -0
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/src/p1_taskqueue.egg-info/top_level.txt +0 -0
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/src/taskqueue/__init__.py +0 -0
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/src/taskqueue/celery_app.py +0 -0
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/src/taskqueue/libs/__init__.py +0 -0
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/src/taskqueue/libs/helper_test.py +0 -0
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/tests/test_celery_app.py +0 -0
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/tests/test_cmanager.py +0 -0
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/tests/test_return_values.py +0 -0
- {p1_taskqueue-0.1.5 → p1_taskqueue-0.1.6}/tests/test_test_utils.py +0 -0
|
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "p1-taskqueue"
|
|
7
7
|
# DO NOT CHANGE THIS VERSION - it gets automatically replaced by CI/CD with the git tag version
|
|
8
|
-
version = "0.1.
|
|
8
|
+
version = "0.1.6"
|
|
9
9
|
description = "A Task Queue Wrapper for Dekoruma Backend"
|
|
10
10
|
authors = [
|
|
11
11
|
{name = "Chalvin", email = "engineering@dekoruma.com"}
|
|
@@ -160,17 +160,18 @@ class CManager:
|
|
|
160
160
|
task_name, task_args, task_kwargs = _build_dynamic_task_call(
|
|
161
161
|
func, *func_args, **func_kwargs)
|
|
162
162
|
|
|
163
|
-
self._send_task(task_name, task_args,
|
|
163
|
+
task_id = self._send_task(task_name, task_args,
|
|
164
|
+
task_kwargs, queue_kwargs)
|
|
164
165
|
|
|
165
|
-
logger.info('[_enqueue_op_base %s] Submit Celery Task SUCCESS, task_name: %s args: %s, kwargs: %s' % (
|
|
166
|
-
enqueue_op_type, task_name, task_args, task_kwargs))
|
|
166
|
+
logger.info('[_enqueue_op_base %s] Submit Celery Task SUCCESS, task_name: %s args: %s, kwargs: %s, task_id: %s' % (
|
|
167
|
+
enqueue_op_type, task_name, task_args, task_kwargs, task_id))
|
|
167
168
|
|
|
168
169
|
except Exception as e:
|
|
169
170
|
logger.exception('[_enqueue_op_base %s] Submit Celery Task FAILED, error: %s, args: %s, kwargs: %s' % (
|
|
170
171
|
enqueue_op_type, str(e), args, kwargs))
|
|
171
172
|
raise e
|
|
172
173
|
|
|
173
|
-
def _send_task(self, task_name: str, task_args: list, task_kwargs: dict, queue_kwargs: Dict[str, Any]) ->
|
|
174
|
+
def _send_task(self, task_name: str, task_args: list, task_kwargs: dict, queue_kwargs: Dict[str, Any]) -> str:
|
|
174
175
|
celery_app = self._get_celery_app()
|
|
175
176
|
|
|
176
177
|
queue_name = queue_kwargs.pop("channel", None)
|
|
@@ -194,8 +195,9 @@ class CManager:
|
|
|
194
195
|
else:
|
|
195
196
|
task_kwargs_with_retry["retry"] = retry_policy
|
|
196
197
|
|
|
197
|
-
celery_app.send_task(task_name, args=task_args,
|
|
198
|
-
|
|
198
|
+
task = celery_app.send_task(task_name, args=task_args,
|
|
199
|
+
kwargs=task_kwargs_with_retry, **send_opts)
|
|
200
|
+
return str(task.id)
|
|
199
201
|
|
|
200
202
|
|
|
201
203
|
cm = CManager()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|