Skip to content

Commit

Permalink
Retry routing task 5 times when signal is locked
Browse files Browse the repository at this point in the history
  • Loading branch information
bartjkdp committed Apr 25, 2023
1 parent 9b3f948 commit 8b1d27c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/signals/apps/signals/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from django.db import connection
from django.db.models import Q
from django.db.utils import OperationalError
from django.utils import timezone

from signals.apps.services.domain.auto_create_children.service import AutoCreateChildrenService
Expand All @@ -23,7 +24,7 @@
dsl_service = SignalDslService()


@app.task
@app.task(autoretry_for=(OperationalError, ), max_retries=5, default_retry_delay=10)
def apply_routing(signal_id):
signal = Signal.objects.get(pk=signal_id)
dsl_service.process_routing_rules(signal)
Expand Down

0 comments on commit 8b1d27c

Please sign in to comment.