From 2e4a920a77645d7966736c5eeaa973ec2a9832b6 Mon Sep 17 00:00:00 2001 From: Bas Schouten Date: Mon, 22 Apr 2024 10:18:30 +0000 Subject: [PATCH] Attempt to improve the update experience further. --- html/pithrottler.js | 2 +- install.sh | 1 - pithrottler.js | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/html/pithrottler.js b/html/pithrottler.js index fb1477f..4f03904 100644 --- a/html/pithrottler.js +++ b/html/pithrottler.js @@ -48,7 +48,7 @@ async function runUpdate() { document.getElementById("updateStatus").innerHTML = "Updating..."; document.getElementById("updateButton").style.display = "none"; const updateAvailable = await fetch("/runupdate"); - location.reload(); + setTimeout(function () { location.reload() }, 500); } function loadPresets() { diff --git a/install.sh b/install.sh index b8ef08f..783d218 100755 --- a/install.sh +++ b/install.sh @@ -2,4 +2,3 @@ npm install sudo cp pithrottler.service /etc/systemd/system/pithrottler.service sudo systemctl enable pithrottler.service -sudo systemctl restart pithrottler.service diff --git a/pithrottler.js b/pithrottler.js index 04295f6..0890e13 100644 --- a/pithrottler.js +++ b/pithrottler.js @@ -32,7 +32,8 @@ const app = (req, res) => { res.setHeader('Access-Control-Allow-Origin', '*'); exec('./update.sh', function (error, stdout, stderr) { - res.end("Done"); + res.end("Done"); + exec("sudo systemctl restart pithrottler.service"); }); return; } -- 2.47.3