Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: the /threads and /db-pool-stat endpoints in api... in... (#35665)

orbisai0security9424bf60b0da
diff --git a/api/extensions/ext_app_metrics.py b/api/extensions/ext_app_metrics.py
index 4a6490b9f04..914baaadafe 100644
--- a/api/extensions/ext_app_metrics.py
+++ b/api/extensions/ext_app_metrics.py
@@ -5,6 +5,7 @@ import threading
from flask import Response
from configs import dify_config
+from controllers.console.admin import admin_required
from dify_app import DifyApp
@@ -25,6 +26,7 @@ def init_app(app: DifyApp):
)
@app.route("/threads")
+ @admin_required
def threads(): # pyright: ignore[reportUnusedFunction]
num_threads = threading.active_count()
threads = threading.enumerate()
@@ -50,6 +52,7 @@ def init_app(app: DifyApp):
}
@app.route("/db-pool-stat")
+ @admin_required
def pool_stat(): # pyright: ignore[reportUnusedFunction]
from extensions.ext_database import db