From fb183205d1ff38dfc956c5ce9c5bb530a57ef115 Mon Sep 17 00:00:00 2001 From: Dongyu Li <544104925@qq.com> Date: Wed, 4 Jun 2025 17:37:19 +0800 Subject: [PATCH] feat(queue_monitor): Add monitoring tasks for the dataset queue. --- api/schedule/queue_monitor_task.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/api/schedule/queue_monitor_task.py b/api/schedule/queue_monitor_task.py index f94d330aeb..e3a7021b9d 100644 --- a/api/schedule/queue_monitor_task.py +++ b/api/schedule/queue_monitor_task.py @@ -18,7 +18,7 @@ parsed = urlparse(celery_broker_url) host = parsed.hostname or "localhost" port = parsed.port or 6379 password = parsed.password or None -redis_db = parsed.path.strip("/") or "1" # type: ignore +redis_db = parsed.path.strip("/") or "1" # type: ignore celery_redis = Redis(host=host, port=port, password=password, db=redis_db) @@ -49,14 +49,14 @@ def queue_monitor_task(): threshold=threshold, alert_time=current_time, ) - mail.send(to=to, - subject="Alert: Dataset Queue pending tasks exceeded the limit", - html=html_content) + mail.send( + to=to, subject="Alert: Dataset Queue pending tasks exceeded the limit", html=html_content + ) except Exception as e: - logging.exception(click.style(f"Exception occurred during sending email", fg="red")) + logging.exception(click.style("Exception occurred during sending email", fg="red")) except Exception as e: - logging.exception(click.style(f"Exception occurred during queue monitoring", fg="red")) + logging.exception(click.style("Exception occurred during queue monitoring", fg="red")) finally: if db.session.is_active: db.session.close()