Skip to content

Commit 1d48516

Browse files
committed
fix: docker shudown do not save statistics
1 parent e8720cd commit 1d48516

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

backend/main.py

+1
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ async def on_startup():
195195
# 关闭时
196196
@app.on_event("shutdown")
197197
async def on_shutdown():
198+
logger.info("On shutdown...")
198199
close_reverse_proxy()
199200
utils.store_statistics.dump()
200201

startup.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
cd /app
33
caddy start --config /app/Caddyfile --adapter caddyfile
44
cd /app/backend
5-
python main.py
5+
# python main.py
6+
exec uvicorn main:app --host 0.0.0.0 --port 8000 --proxy-headers --forwarded-allow-ips '*' --log-config logging_config.yaml

0 commit comments

Comments
 (0)