From dbe387f666f28fe3625d91f219911d579ea4d5b1 Mon Sep 17 00:00:00 2001 From: Ke Sun Date: Mon, 30 Mar 2026 20:53:17 +0800 Subject: [PATCH] fix(tasks): increase redis lock timeout and expiration for write_message_task - Increase lock expiration time from 120 to 600 seconds (5 minutes) - Increase lock timeout from 300 to 3600 seconds (1 hour) - Prevents premature lock release during long-running memory write operations --- api/app/tasks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/app/tasks.py b/api/app/tasks.py index 4928ca7f..72421a5f 100644 --- a/api/app/tasks.py +++ b/api/app/tasks.py @@ -1180,8 +1180,8 @@ def write_message_task( lock = RedisFairLock( key=f"memory_write:{end_user_id}", redis_client=redis_client, - expire=120, - timeout=300, + expire=600, + timeout=3600, auto_renewal=True, ) if not lock.acquire():