mirror of
https://github.com/langgenius/dify.git
synced 2026-05-12 12:00:41 -04:00
fix: the /threads and /db-pool-stat endpoints in api... in... (#35665)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user