Add verbose output to runperiodic management command

This commit is contained in:
Raphael Michel
2020-09-06 22:34:40 +02:00
parent 4b894eb433
commit d064a7affa
3 changed files with 38 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
from datetime import timedelta
from django.conf import settings
from django.core.management import call_command
from django.dispatch import receiver
from django.utils.timezone import now
from django_scopes import scopes_disabled
@@ -40,3 +41,9 @@ def clean_cached_tickets(sender, **kwargs):
cf.delete()
for cf in CachedCombinedTicket.objects.filter(created__lte=now() - timedelta(minutes=30), file__isnull=True):
cf.delete()
@receiver(signal=periodic_task)
@scopes_disabled()
def clearsessions(sender, **kwargs):
call_command('clearsessions')