p1-taskqueue 0.1.23__tar.gz → 0.1.24__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.
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/PKG-INFO +1 -1
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/pyproject.toml +1 -1
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/src/p1_taskqueue.egg-info/PKG-INFO +1 -1
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/src/taskqueue/cmanager.py +7 -1
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/src/taskqueue/migrations/0001_initial.py +7 -1
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/src/taskqueue/models.py +6 -1
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/README.md +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/setup.cfg +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/src/p1_taskqueue.egg-info/SOURCES.txt +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/src/p1_taskqueue.egg-info/dependency_links.txt +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/src/p1_taskqueue.egg-info/requires.txt +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/src/p1_taskqueue.egg-info/top_level.txt +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/src/taskqueue/__init__.py +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/src/taskqueue/apps.py +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/src/taskqueue/celery_app.py +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/src/taskqueue/libs/__init__.py +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/src/taskqueue/libs/helper_test.py +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/src/taskqueue/migrations/__init__.py +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/src/taskqueue/slack_notifier.py +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/tests/test_celery_app.py +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/tests/test_cmanager.py +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/tests/test_helper_test_functions.py +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/tests/test_return_values.py +0 -0
- {p1_taskqueue-0.1.23 → p1_taskqueue-0.1.24}/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.24"
|
|
9
9
|
description = "A Task Queue Wrapper for Dekoruma Backend"
|
|
10
10
|
authors = [
|
|
11
11
|
{name = "Chalvin", email = "engineering@dekoruma.com"}
|
|
@@ -317,11 +317,12 @@ class CManager:
|
|
|
317
317
|
queue_name: str, job_timeout: int, retry_policy: dict, countdown: int, eta: Any) -> str:
|
|
318
318
|
task_id = str(uuid.uuid4())
|
|
319
319
|
|
|
320
|
+
task_result_obj = None
|
|
320
321
|
try:
|
|
321
322
|
from django_celery_results.models import TaskResult
|
|
322
323
|
from django.utils import timezone
|
|
323
324
|
|
|
324
|
-
TaskResult.objects.create(
|
|
325
|
+
task_result_obj = TaskResult.objects.create(
|
|
325
326
|
task_id=task_id,
|
|
326
327
|
task_name=task_name,
|
|
327
328
|
status='PENDING',
|
|
@@ -339,7 +340,12 @@ class CManager:
|
|
|
339
340
|
pickled_task_args = self._pickle_data(task_args)
|
|
340
341
|
pickled_task_kwargs = self._pickle_data(task_kwargs)
|
|
341
342
|
|
|
343
|
+
if task_result_obj is None:
|
|
344
|
+
raise ValueError(
|
|
345
|
+
f"Failed to create TaskResult for task id: {task_id}")
|
|
346
|
+
|
|
342
347
|
TaskReconstruction.objects.create(
|
|
348
|
+
task_result=task_result_obj,
|
|
343
349
|
task_id=task_id,
|
|
344
350
|
task_name=task_name,
|
|
345
351
|
task_args=pickled_task_args,
|
|
@@ -12,8 +12,14 @@ class Migration(migrations.Migration):
|
|
|
12
12
|
migrations.CreateModel(
|
|
13
13
|
name='TaskReconstruction',
|
|
14
14
|
fields=[
|
|
15
|
+
('id', models.AutoField(
|
|
16
|
+
auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
17
|
+
('task_result', models.OneToOneField(
|
|
18
|
+
on_delete=models.deletion.CASCADE,
|
|
19
|
+
to='django_celery_results.taskresult',
|
|
20
|
+
)),
|
|
15
21
|
('task_id', models.CharField(
|
|
16
|
-
max_length=255,
|
|
22
|
+
db_index=True, max_length=255, unique=True)),
|
|
17
23
|
('task_name', models.CharField(max_length=255)),
|
|
18
24
|
('task_args', models.TextField()),
|
|
19
25
|
('task_kwargs', models.TextField()),
|
|
@@ -2,7 +2,12 @@ from django.db import models
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class TaskReconstruction(models.Model):
|
|
5
|
-
|
|
5
|
+
task_result = models.OneToOneField(
|
|
6
|
+
'django_celery_results.TaskResult',
|
|
7
|
+
on_delete=models.CASCADE,
|
|
8
|
+
)
|
|
9
|
+
# @note(chalvin): same task task_result.task_id. Saved for performance.
|
|
10
|
+
task_id = models.CharField(max_length=255, unique=True, db_index=True)
|
|
6
11
|
task_name = models.CharField(max_length=255)
|
|
7
12
|
task_args = models.TextField()
|
|
8
13
|
task_kwargs = models.TextField()
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|