Files
Jens 5e2453c29a
deploy / deploy (push) Canceled after 0s
feat: professionalize platform release 0.3.13
2026-07-29 16:35:37 +02:00

18 lines
588 B
Python

from __future__ import annotations
from celery import shared_task
from django.core.cache import cache
from django.utils import timezone
RUNTIME_HEARTBEAT_KEY = "vacatureradar:runtime:heartbeat"
RUNTIME_HEARTBEAT_TTL_SECONDS = 180
@shared_task(name="apps.core.tasks.record_runtime_heartbeat", ignore_result=True)
def record_runtime_heartbeat() -> str:
"""Record proof that beat dispatch and a worker execution both succeeded."""
timestamp = timezone.now().isoformat()
cache.set(RUNTIME_HEARTBEAT_KEY, timestamp, timeout=RUNTIME_HEARTBEAT_TTL_SECONDS)
return timestamp