From 571aabe3a2d6ce41d973ce1e8733e3297bb0a50a Mon Sep 17 00:00:00 2001 From: Cp0204 Date: Wed, 27 Mar 2024 17:28:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Ddocker=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=BF=90=E8=A1=8C=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/run.py | 8 ++++---- app/templates/index.html | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/run.py b/app/run.py index ef033df..02b9888 100644 --- a/app/run.py +++ b/app/run.py @@ -25,7 +25,7 @@ script_path = os.environ.get("SCRIPT_PATH", "./quark_auto_save.py") config_path = os.environ.get("CONFIG_PATH", "./config/quark_config.json") app = Flask(__name__) -app.config["APP_VERSION"] = "0.2.4" +app.config["APP_VERSION"] = "0.2.4.1" app.secret_key = "ca943f6db6dd34823d36ab08d8d6f65d" app.json.ensure_ascii = False app.json.sort_keys = False @@ -149,8 +149,8 @@ def run_script_now(): # 定时任务执行的函数 -def run_script(script_path): - os.system(f"python {script_path}") +def run_script(args): + os.system(f"{python_path} {args}") # 重新加载任务 @@ -168,7 +168,7 @@ def reload_tasks(): trigger = CronTrigger.from_crontab(crontab) scheduler.remove_all_jobs() scheduler.add_job( - run_script, trigger=trigger, args=[f"{python_path} {script_path} {config_path}"] + run_script, trigger=trigger, args=[f"{script_path} {config_path}"] ) if scheduler.state == 2: scheduler.resume() # 恢复调度器 diff --git a/app/templates/index.html b/app/templates/index.html index 0c93961..0c47539 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -204,8 +204,7 @@ for (key in newVal) { if (newVal[key].toLowerCase() === 'false') { this.$set(this.formData.push_config, key, false); - } - if (newVal[key].toLowerCase() === 'true') { + } else if (newVal[key].toLowerCase() === 'true') { this.$set(this.formData.push_config, key, true); } }