From aa9ed081298efb30812432bd065138efbe8d59bc Mon Sep 17 00:00:00 2001 From: Tal Borenstein Date: Wed, 20 Nov 2024 14:35:15 +0200 Subject: [PATCH] fix(arq): incidents processing --- keep/api/routes/incidents.py | 2 +- keep/api/tasks/process_incident_task.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/keep/api/routes/incidents.py b/keep/api/routes/incidents.py index d670a6ac6..7b2c02130 100644 --- a/keep/api/routes/incidents.py +++ b/keep/api/routes/incidents.py @@ -544,12 +544,12 @@ async def receive_event( redis: ArqRedis = await get_pool() job = await redis.enqueue_job( "async_process_incident", - {}, authenticated_entity.tenant_id, provider_id, provider_type, event, trace_id, + _queue_name=KEEP_ARQ_QUEUE_BASIC, ) logger.info( "Enqueued job", diff --git a/keep/api/tasks/process_incident_task.py b/keep/api/tasks/process_incident_task.py index e189526b0..2b60b6b59 100644 --- a/keep/api/tasks/process_incident_task.py +++ b/keep/api/tasks/process_incident_task.py @@ -32,6 +32,10 @@ def process_incident( "trace_id": trace_id, } + if ctx and isinstance(ctx, dict): + extra["job_try"] = ctx.get("job_try", 0) + extra["job_id"] = ctx.get("job_id", None) + if isinstance(incidents, IncidentDto): incidents = [incidents]