Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
db-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yzy
db-tools
Commits
8efd6c9d
Commit
8efd6c9d
authored
Sep 29, 2026
by
wangteng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页 分析 功能上线
parent
4ece8b72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
web/backend/app.py
web/backend/app.py
+2
-1
No files found.
web/backend/app.py
View file @
8efd6c9d
...
...
@@ -41,9 +41,10 @@ logger.info("DB: %s", engine.url.render_as_string(hide_password=True))
# 2026-09-29:新版 FastAPI 已移除 app.add_event_handler,改用 lifespan 挂调度器启停;
# start_scheduler/stop_scheduler 由下方路由 import 绑定到模块全局,lifespan 执行时已就绪
# 注意:正式服务器是 Python 3.8,asyncio.to_thread 是 3.9+ API —— 用 run_in_executor 兼容
@
asynccontextmanager
async
def
_lifespan
(
_
:
FastAPI
):
await
asyncio
.
to_thread
(
start_scheduler
)
await
asyncio
.
get_event_loop
().
run_in_executor
(
None
,
start_scheduler
)
yield
stop_scheduler
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment