update pay function

This commit is contained in:
2025-11-27 11:28:57 +08:00
parent 62cf0a6c7d
commit 900aff17df
5 changed files with 1469 additions and 121 deletions

View File

@@ -6407,10 +6407,31 @@ def api_method_not_allowed(error):
return error
# 应用启动时自动初始化(兼容 Gunicorn 和直接运行)
_sywg_cache_initialized = False
def ensure_sywg_cache_initialized():
"""确保申银万国行业分类缓存已初始化(懒加载,首次请求时触发)"""
global _sywg_cache_initialized
if not _sywg_cache_initialized:
init_sywg_industry_cache()
_sywg_cache_initialized = True
@app.before_request
def before_request_init():
"""首次请求时初始化缓存"""
global _sywg_cache_initialized
if not _sywg_cache_initialized:
ensure_sywg_cache_initialized()
if __name__ == '__main__':
# 初始化申银万国行业分类缓存
# 直接运行时,立即初始化缓存
with app.app_context():
init_sywg_industry_cache()
_sywg_cache_initialized = True
app.run(
host='0.0.0.0',