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.
Files changed (24) hide show
  1. {django_taskq-1.0.2/django_taskq.egg-info → django_taskq-1.0.2.2}/PKG-INFO +1 -1
  2. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/migrations/0001_initial.py +1 -1
  3. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/models.py +3 -1
  4. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/tests.py +10 -0
  5. {django_taskq-1.0.2 → django_taskq-1.0.2.2/django_taskq.egg-info}/PKG-INFO +1 -1
  6. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/setup.cfg +1 -1
  7. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/LICENSE +0 -0
  8. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/MANIFEST.in +0 -0
  9. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/README.rst +0 -0
  10. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/__init__.py +0 -0
  11. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/admin.py +0 -0
  12. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/apps.py +0 -0
  13. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/celery.py +0 -0
  14. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/celery.pyi +0 -0
  15. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/management/__init__.py +0 -0
  16. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/management/commands/__init__.py +0 -0
  17. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/management/commands/taskq.py +0 -0
  18. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq/migrations/__init__.py +0 -0
  19. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq.egg-info/SOURCES.txt +0 -0
  20. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq.egg-info/dependency_links.txt +0 -0
  21. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq.egg-info/requires.txt +0 -0
  22. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/django_taskq.egg-info/top_level.txt +0 -0
  23. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/pyproject.toml +0 -0
  24. {django_taskq-1.0.2 → django_taskq-1.0.2.2}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-taskq
3
- Version: 1.0.2
3
+ Version: 1.0.2.2
4
4
  Summary: A simple Celery-like database-backed task queue for Django
5
5
  Home-page: https://github.com/aivarsk/django-taskq
6
6
  Author: Aivars Kalvans
@@ -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(auto_now_add=True)),
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(auto_now_add=True)
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-taskq
3
- Version: 1.0.2
3
+ Version: 1.0.2.2
4
4
  Summary: A simple Celery-like database-backed task queue for Django
5
5
  Home-page: https://github.com/aivarsk/django-taskq
6
6
  Author: Aivars Kalvans
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = django-taskq
3
- version = 1.0.2
3
+ version = 1.0.2.2
4
4
  description = A simple Celery-like database-backed task queue for Django
5
5
  long_description = file: README.rst
6
6
  url = https://github.com/aivarsk/django-taskq
File without changes
File without changes
File without changes
File without changes