Fix xinfo_groups returns unexpected result (#4026)

### What problem does this PR solve?

Fix xinfo_groups returns unexpected result. Close #3545 

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Zhichang Yu 2024-12-13 17:31:15 +08:00 committed by GitHub
parent 86507af770
commit 9b2ef62aee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -529,8 +529,8 @@ def report_status():
now = datetime.now()
group_info = REDIS_CONN.queue_info(SVR_QUEUE_NAME, "rag_flow_svr_task_broker")
if group_info is not None:
PENDING_TASKS = int(group_info["pending"])
LAG_TASKS = int(group_info["lag"])
PENDING_TASKS = int(group_info.get("pending", 0))
LAG_TASKS = int(group_info.get("lag", 0))
with mt_lock:
heartbeat = json.dumps({