浏览代码

fix: disable gevent in debug mode for better compatibility with JetBrains Python debugger (#12299)

Signed-off-by: -LAN- <laipz8200@outlook.com>
tags/0.15.0
-LAN- 10 个月前
父节点
当前提交
3c45bdf18a
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      api/app.py

+ 4
- 1
api/app.py 查看文件

@@ -14,7 +14,10 @@ if is_db_command():

app = create_migrations_app()
else:
if os.environ.get("FLASK_DEBUG", "False") != "True":
# It seems that JetBrains Python debugger does not work well with gevent,
# so we need to disable gevent in debug mode.
# If you are using debugpy and set GEVENT_SUPPORT=True, you can debug with gevent.
if (flask_debug := os.environ.get("FLASK_DEBUG", "0")) and flask_debug.lower() not in {"false", "0", "no"}:
from gevent import monkey # type: ignore

# gevent

正在加载...
取消
保存