Spaces:
Paused
Paused
Move initialization calls outside __main__ block
Browse filesMove the creation of `AuthTokenManager` and the call to `initialization()`
to the module level. This ensures these setup steps are executed upon
module import, making the token manager and initialized resources
available immediately for other parts of the application.
app.py
CHANGED
|
@@ -412,9 +412,10 @@ def get_system_status():
|
|
| 412 |
return jsonify({"error": "无法获取系统状态"}), 500
|
| 413 |
|
| 414 |
|
|
|
|
|
|
|
|
|
|
| 415 |
if __name__ == '__main__':
|
| 416 |
-
token_manager = AuthTokenManager() # 创建 AuthTokenManager 实例
|
| 417 |
-
initialization()
|
| 418 |
app.run(
|
| 419 |
host='0.0.0.0',
|
| 420 |
port=CONFIG["SERVER"]["PORT"],
|
|
|
|
| 412 |
return jsonify({"error": "无法获取系统状态"}), 500
|
| 413 |
|
| 414 |
|
| 415 |
+
token_manager = AuthTokenManager() # 创建 AuthTokenManager 实例
|
| 416 |
+
initialization()
|
| 417 |
+
|
| 418 |
if __name__ == '__main__':
|
|
|
|
|
|
|
| 419 |
app.run(
|
| 420 |
host='0.0.0.0',
|
| 421 |
port=CONFIG["SERVER"]["PORT"],
|