diff --git a/module/web.py b/module/web.py index f59e929..95e4eb5 100644 --- a/module/web.py +++ b/module/web.py @@ -1239,7 +1239,19 @@ def api_settings_general(): with open(CONFIG_FILE_PATH, "w", encoding="utf-8") as f: yaml_inst.dump(config, f) + # 同步更新内存中的配置,避免重启前 update_config() 把新值覆盖回旧值 if _app: + if "max_download_task" in data: + _app.config["max_download_task"] = config["max_download_task"] + if "log_level" in data: + _app.config["log_level"] = config["log_level"] + if "save_path" in data and data.get("save_path"): + _app.config["save_path"] = config["save_path"] + if "proxy" in data: + if "proxy" in config: + _app.config["proxy"] = dict(config["proxy"]) + else: + _app.config.pop("proxy", None) _app.restart_program = True return jsonify({"success": True})