From 1584613191e7cb7ee71ab35025584555662e1913 Mon Sep 17 00:00:00 2001 From: Spencer Hawkins Date: Tue, 2 Oct 2018 23:41:25 -0700 Subject: [PATCH] increase interval to 10s to reduce possibility of double-checking updater status too fast --- build.sh | 4 ++-- electron/main.js | 10 +++++++--- electron/settings.html | 25 +++++++++++++++++++++++++ electron/updates.js | 1 + 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index 9c9aaacb..eec459a2 100644 --- a/build.sh +++ b/build.sh @@ -46,7 +46,6 @@ yes | ./electron/node_modules/.bin/electron-packager electron/ MTGATracker \ --asar mv MTGATracker-win32-x64 MTGATracker-win32-x64_$version -/c/Program\ Files/7-Zip/7z.exe a -tzip MTGATracker-win32-x64_$version.zip MTGATracker-win32-x64_$version cd electron cat > testbuild.js <<- EOM @@ -86,7 +85,8 @@ sleep 1 DEBUG=electron-windows-installer:main node testbuild.js -md5sum ../MTGATracker-win32-x64_$version.zip +mv MTGATracker-win32-x64_$version-SQUIRREL/Setup.exe MTGATracker-win32-x64_$version-SQUIRREL/setup_mtgatracker_$version.exe + end=$(date +%s) secs=$((end-start)) printf 'build took %dh:%dm:%ds\n' $(($secs/3600)) $(($secs%3600/60)) $(($secs%60)) \ No newline at end of file diff --git a/electron/main.js b/electron/main.js index b884fef1..82f00230 100644 --- a/electron/main.js +++ b/electron/main.js @@ -3,6 +3,7 @@ const jwt = require('jsonwebtoken'); global.updateReady = false global.updateDownloading = false +global.checkInProgress = false const { handleStartupEvent, updater } = require("./updates") if (handleStartupEvent()) { @@ -70,16 +71,19 @@ const runFromSource = !process.execPath.endsWith("MTGATracker.exe") if (!firstRun && fs.existsSync(path.resolve(path.dirname(process.execPath), '..', 'update.exe'))) { setInterval(() => { - if (!global.updateDownloading) { + if (!global.updateDownloading && !global.checkInProgress) { + global.checkInProgress = true updater.check((err, status) => { if (!err && status) { // Download the update - updater.download() global.updateDownloading = true; + updater.download() } + // the check is complete, we can run the check again now + global.checkInProgress = false }) } - }, 1000) + }, 10000) } const findProcess = require('find-process'); diff --git a/electron/settings.html b/electron/settings.html index 63853ee3..16106746 100644 --- a/electron/settings.html +++ b/electron/settings.html @@ -69,6 +69,31 @@

About MTGATracker

Current Vault Progress: { lastVaultProgress }%

+
+

Release notes for 4.1.2 (and 4.1.1)

+ +

Release notes for 4.0.0