diff --git a/.env b/.env index 3ad91698a8..d25e891a37 100644 --- a/.env +++ b/.env @@ -16,7 +16,7 @@ OIDC_RSA_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\nMIIJKQIBAAKCAgEA92+93Tyg6 # Worker config # WORKER_IMMEDIATE_MODE=True -TRACKING_PULSE=120 +TRACKING_PULSE=1200 ## Email auth # EMAIL_PORT=1025 diff --git a/modules/events/karrio/server/events/task_definitions/base/__init__.py b/modules/events/karrio/server/events/task_definitions/base/__init__.py index 1c1e0d996d..0674449b17 100644 --- a/modules/events/karrio/server/events/task_definitions/base/__init__.py +++ b/modules/events/karrio/server/events/task_definitions/base/__init__.py @@ -27,15 +27,17 @@ def _run(**kwargs): _run() -@db_task() +@db_task(retries=5, retry_delay=60) @utils.tenant_aware def notify_webhooks(*args, **kwargs): - from karrio.server.events.task_definitions.base import webhook + try: + from karrio.server.events.task_definitions.base import webhook - utils.failsafe( - lambda: webhook.notify_webhook_subscribers(*args, **kwargs), - "An error occured during webhook notification: $error", - ) + webhook.notify_webhook_subscribers(*args, **kwargs) + + except Exception as e: + logger.error(f"An error occured during webhook notification: {e}") + raise e @db_periodic_task(crontab(hour=f"*/{DATA_ARCHIVING_SCHEDULE}")) @@ -54,6 +56,7 @@ def _run(**kwargs): _run() + TASK_DEFINITIONS = [ background_trackers_update, periodic_data_archiving,