django-taskq 1.0.2__tar.gz → 1.0.2.2__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.
- {django_taskq-1.0.2/django_taskq.egg-info → django_taskq-1.0.2.2}/PKG-INFO +1 -1
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/migrations/0001_initial.py +1 -1
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/models.py +3 -1
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/tests.py +10 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2/django_taskq.egg-info}/PKG-INFO +1 -1
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/setup.cfg +1 -1
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/LICENSE +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/MANIFEST.in +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/README.rst +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/__init__.py +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/admin.py +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/apps.py +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/celery.py +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/celery.pyi +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/management/__init__.py +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/management/commands/__init__.py +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/management/commands/taskq.py +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/migrations/__init__.py +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq.egg-info/SOURCES.txt +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq.egg-info/dependency_links.txt +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq.egg-info/requires.txt +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq.egg-info/top_level.txt +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/pyproject.toml +0 -0
- {django_taskq-1.0.2 → django_taskq-1.0.2.2}/setup.py +0 -0
|
@@ -29,7 +29,7 @@ class Migration(migrations.Migration):
|
|
|
29
29
|
("kwargs", picklefield.fields.PickledObjectField(editable=False)),
|
|
30
30
|
("repr", models.CharField(max_length=512)),
|
|
31
31
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
32
|
-
("execute_at", models.DateTimeField(
|
|
32
|
+
("execute_at", models.DateTimeField(editable=False)),
|
|
33
33
|
("expires_at", models.DateTimeField(blank=True, null=True)),
|
|
34
34
|
(
|
|
35
35
|
"alive_at",
|
|
@@ -31,7 +31,7 @@ class Task(models.Model):
|
|
|
31
31
|
repr = models.CharField(max_length=512)
|
|
32
32
|
|
|
33
33
|
created_at = models.DateTimeField(auto_now_add=True, editable=False)
|
|
34
|
-
execute_at = models.DateTimeField(
|
|
34
|
+
execute_at = models.DateTimeField(editable=False)
|
|
35
35
|
expires_at = models.DateTimeField(null=True, blank=True)
|
|
36
36
|
alive_at = models.DateTimeField(null=True, blank=True, editable=False)
|
|
37
37
|
|
|
@@ -49,6 +49,8 @@ class Task(models.Model):
|
|
|
49
49
|
def save(self, *args, **kwargs):
|
|
50
50
|
self.queue = self.queue or self.DEFAULTQ
|
|
51
51
|
self.repr = self._make_repr()
|
|
52
|
+
if not self.execute_at:
|
|
53
|
+
self.execute_at = timezone.now()
|
|
52
54
|
super().save(*args, **kwargs)
|
|
53
55
|
|
|
54
56
|
def fail(self, exc):
|
|
@@ -81,6 +81,16 @@ class CeleryInterfaceTestCase(TestCase):
|
|
|
81
81
|
task = Task.objects.last()
|
|
82
82
|
self.assertEqual(task.repr, "django_taskq.tests.dummy(1, 2)")
|
|
83
83
|
|
|
84
|
+
def test_shared_task_signature_apply_async_countdown(self):
|
|
85
|
+
now = timezone.now()
|
|
86
|
+
print(now)
|
|
87
|
+
dummy.s(1, 2).apply_async(countdown=10)
|
|
88
|
+
|
|
89
|
+
task = Task.objects.last()
|
|
90
|
+
self.assertEqual(task.repr, "django_taskq.tests.dummy(1, 2)")
|
|
91
|
+
self.assertGreaterEqual(task.execute_at - now, datetime.timedelta(seconds=10))
|
|
92
|
+
|
|
93
|
+
|
|
84
94
|
def test_shared_task_fail(self):
|
|
85
95
|
failing_task.delay()
|
|
86
96
|
|
|
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
|