Permalink
Browse files

increase interval to 10s to reduce possibility of double-checking upd…

…ater status too fast
  • Loading branch information...
shawkinsl committed Oct 3, 2018
1 parent 3d6722d commit 1584613191e7cb7ee71ab35025584555662e1913
Showing with 35 additions and 5 deletions.
  1. +2 −2 build.sh
  2. +7 −3 electron/main.js
  3. +25 −0 electron/settings.html
  4. +1 −0 electron/updates.js
@@ -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))
@@ -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');
@@ -69,6 +69,31 @@ <h3><i>About MTGATracker</i></h3>

<h4>Current Vault Progress: { lastVaultProgress }%</h4>

<br />
<h3>Release notes for 4.1.2 (and 4.1.1)</h3>
<ul>
<li class="about-p">
Duplicate notifications will now only appear once with an incrementing badge counter
</li>
<li>
Fixed an issue that caused an error message during application updates
</li>
<li>
Deck names can no longer cover the zoom buttons (thank you
<a href="https://github.com/mtgatracker/mtgatracker/commit/a4a2d4038c4f90e8fdd10109ba01cf377067eddc">Alex</a>!)
</li>
<li>
Fixed an issue where some users may be unable to authorize Inspector
<a href="https://github.com/mtgatracker/mtgatracker/commit/6c0f4ec54f6ff2d1fcc539df603df1f543d7d69f">Ravi</a>!)
<b>If you're still unable to authorize Inspector or cannot see matches in Inspector, please contact us on
Discord!</b>
</li>
<li>
Precon deck names will no longer show up as "?=?Loc/Decks/Precon/Precon_NPE_XY", and instead will
show their in-game deck name.
</li>
</ul>

<br />
<h3>Release notes for 4.0.0</h3>
<ul>
@@ -61,6 +61,7 @@ let options = {
}

const updater = new GhReleases(options)
updater.autoUpdater.autoDownload = false; // fix issue where multiple downloaders fight over the lock

module.exports = {
handleStartupEvent: handleStartupEvent,

0 comments on commit 1584613

Please sign in to comment.