Fix init-only mode for PostgreSQL deploy script imports.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-01 08:14:43 +08:00
parent a1f22624de
commit 008f042fcc
2 changed files with 17 additions and 16 deletions
+15 -15
View File
@@ -543,7 +543,8 @@ def sync_ths_token():
set_ths_refresh_token(get_setting("ths_refresh_token"))
sync_ths_token()
if os.getenv("QIHUO_INIT_ONLY") != "1":
sync_ths_token()
def build_market_quote_payload(
@@ -2224,20 +2225,19 @@ def settings():
)
install_trading(
app,
login_required=login_required,
require_nav=require_nav,
get_db=get_db,
get_setting=get_setting,
set_setting=set_setting,
fetch_price=fetch_price,
send_wechat_msg=send_wechat_msg,
)
try_init_vnpy({})
start_background_threads()
if os.getenv("QIHUO_INIT_ONLY") != "1":
install_trading(
app,
login_required=login_required,
require_nav=require_nav,
get_db=get_db,
get_setting=get_setting,
set_setting=set_setting,
fetch_price=fetch_price,
send_wechat_msg=send_wechat_msg,
)
try_init_vnpy({})
start_background_threads()
# —————————————— 启动 ——————————————