This commit is contained in:
2026-04-29 03:47:48 +03:30
parent 27784ee8b9
commit 8139a49756
11 changed files with 533 additions and 197 deletions
+21
View File
@@ -0,0 +1,21 @@
import logging
from celery import shared_task
from .services import sync_all_farm_alert_trackers
logger = logging.getLogger("farm_alerts")
@shared_task(
bind=True,
autoretry_for=(Exception,),
retry_backoff=True,
retry_jitter=True,
retry_kwargs={"max_retries": 3},
)
def sync_farm_alert_trackers(self):
logger.info("farm alerts periodic sync task started task_id=%s", getattr(self.request, "id", ""))
result = sync_all_farm_alert_trackers()
logger.info("farm alerts periodic sync task finished result=%s", result)
return result