We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36d5bea commit 296b32aCopy full SHA for 296b32a
1 file changed
errata/apps.py
@@ -19,3 +19,17 @@
19
20
class ErrataConfig(AppConfig):
21
name = 'errata'
22
+
23
+ def ready(self):
24
+ from datetime import timedelta
25
26
+ from django.db.models.signals import post_save
27
+ from django.utils import timezone
28
29
+ def set_initial_last_run(sender, instance, created, **kwargs):
30
+ if created and instance.name == 'update_errata_cves_cwes_every_12_hours':
31
+ instance.last_run_at = timezone.now() - timedelta(days=1)
32
+ instance.save(update_fields=['last_run_at'])
33
34
+ from django_celery_beat.models import PeriodicTask
35
+ post_save.connect(set_initial_last_run, sender=PeriodicTask)
0 commit comments