Skip to content

Commit

Permalink
increase interval to 10s to reduce possibility of double-checking upd…
Browse files Browse the repository at this point in the history
…ater status too fast
  • Loading branch information
Spencatro committed Oct 3, 2018
1 parent 3d6722d commit 1584613
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build.sh
Expand Up @@ -46,7 +46,6 @@ yes | ./electron/node_modules/.bin/electron-packager electron/ MTGATracker \
--asar --asar


mv MTGATracker-win32-x64 MTGATracker-win32-x64_$version 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 cd electron
cat > testbuild.js <<- EOM cat > testbuild.js <<- EOM
Expand Down Expand Up @@ -86,7 +85,8 @@ sleep 1


DEBUG=electron-windows-installer:main node testbuild.js 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) end=$(date +%s)
secs=$((end-start)) secs=$((end-start))
printf 'build took %dh:%dm:%ds\n' $(($secs/3600)) $(($secs%3600/60)) $(($secs%60)) printf 'build took %dh:%dm:%ds\n' $(($secs/3600)) $(($secs%3600/60)) $(($secs%60))
10 changes: 7 additions & 3 deletions electron/main.js
Expand Up @@ -3,6 +3,7 @@ const jwt = require('jsonwebtoken');


global.updateReady = false global.updateReady = false
global.updateDownloading = false global.updateDownloading = false
global.checkInProgress = false
const { handleStartupEvent, updater } = require("./updates") const { handleStartupEvent, updater } = require("./updates")


if (handleStartupEvent()) { if (handleStartupEvent()) {
Expand Down Expand Up @@ -70,16 +71,19 @@ const runFromSource = !process.execPath.endsWith("MTGATracker.exe")


if (!firstRun && fs.existsSync(path.resolve(path.dirname(process.execPath), '..', 'update.exe'))) { if (!firstRun && fs.existsSync(path.resolve(path.dirname(process.execPath), '..', 'update.exe'))) {
setInterval(() => { setInterval(() => {
if (!global.updateDownloading) { if (!global.updateDownloading && !global.checkInProgress) {
global.checkInProgress = true
updater.check((err, status) => { updater.check((err, status) => {
if (!err && status) { if (!err && status) {
// Download the update // Download the update
updater.download()
global.updateDownloading = true; 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'); const findProcess = require('find-process');
Expand Down
25 changes: 25 additions & 0 deletions electron/settings.html
Expand Up @@ -69,6 +69,31 @@ <h3><i>About MTGATracker</i></h3>


<h4>Current Vault Progress: { lastVaultProgress }%</h4> <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 /> <br />
<h3>Release notes for 4.0.0</h3> <h3>Release notes for 4.0.0</h3>
<ul> <ul>
Expand Down
1 change: 1 addition & 0 deletions electron/updates.js
Expand Up @@ -61,6 +61,7 @@ let options = {
} }


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


module.exports = { module.exports = {
handleStartupEvent: handleStartupEvent, handleStartupEvent: handleStartupEvent,
Expand Down

0 comments on commit 1584613

Please sign in to comment.