From e85710dd7b1ab5196c4a721f5c64efd7d7588349 Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Mon, 1 Jun 2026 20:59:41 +0530 Subject: [PATCH] feat(gateway): include Discord in gateway maintenance --- surfsense_backend/app/tasks/celery_tasks/gateway_tasks.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/surfsense_backend/app/tasks/celery_tasks/gateway_tasks.py b/surfsense_backend/app/tasks/celery_tasks/gateway_tasks.py index e227db71d..898d8c8af 100644 --- a/surfsense_backend/app/tasks/celery_tasks/gateway_tasks.py +++ b/surfsense_backend/app/tasks/celery_tasks/gateway_tasks.py @@ -92,6 +92,13 @@ def gateway_health_check_task() -> None: cursor_state[key] = metadata[key] account.cursor_state = cursor_state account.bot_username = metadata.get("bot_username") + elif account.platform == ExternalChatPlatform.DISCORD: + cursor_state = dict(account.cursor_state or {}) + for key in ("bot_user_id", "bot_username", "global_name"): + if key in metadata: + cursor_state[key] = metadata[key] + account.cursor_state = cursor_state + account.bot_username = metadata.get("bot_username") except Exception: logger.warning( "External chat health check failed platform=%s account_id=%s",