v1.0.56: recheck for updates every 30 minutes, not just once at startup

The auto-updater used a one-shot setTimeout, so a version pushed after the
initial 10s post-launch check would sit unapplied until Stream Deck restarted
or someone hit the manual Check for Updates button.
This commit is contained in:
pdmarf
2026-10-07 18:36:51 +01:00
parent e2e29cc876
commit b08126e06e
5 changed files with 12 additions and 4 deletions
+7 -1
View File
@@ -1,4 +1,4 @@
const CURRENT_VERSION = "1.0.55";
const CURRENT_VERSION = "1.0.56";
const GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild";
const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
@@ -375,6 +375,12 @@ streamDeck.ui.onSendToPlugin<{ event: string; settings?: TimerSettings; token?:
}
});
const UPDATE_CHECK_INTERVAL_MS = 30 * 60 * 1000; // 30 minutes
streamDeck.connect();
// Initial check shortly after startup, then keep rechecking — a plugin process
// can run for days without Stream Deck restarting, and the old code only ever
// checked once per process lifetime.
setTimeout(() => checkForUpdates(), 10_000);
setInterval(() => checkForUpdates(), UPDATE_CHECK_INTERVAL_MS);