Skip to content
Snippets Groups Projects
Verified Commit 68b173c9 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Add default schedules to check_data and PDF expiry

parent 27929007
No related branches found
No related tags found
1 merge request!939More default schedules
import logging
from datetime import timedelta
from django.apps import apps
from django.contrib.contenttypes.models import ContentType
......@@ -236,7 +237,7 @@ class DataCheckRegistry:
return [(check.name, check.verbose_name) for check in cls.data_checks]
@recorded_task
@recorded_task(run_every=timedelta(minutes=15))
def check_data(recorder: ProgressRecorder):
"""Execute all registered data checks and send email if activated."""
for check in recorder.iterate(DataCheckRegistry.data_checks):
......
import os
import subprocess # noqa
from datetime import timedelta
from tempfile import TemporaryDirectory
from typing import Optional, Tuple, Union
from urllib.parse import urljoin
......@@ -129,7 +130,7 @@ def clean_up_expired_pdf_files() -> None:
PDFFile.objects.filter(expires_at__lt=timezone.now()).delete()
@app.task
@app.task(run_every=timedelta(days=1))
def clean_up_expired_pdf_files_task() -> None:
"""Clean up expired PDF files."""
return clean_up_expired_pdf_files()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment