Skip to content

Commit

Permalink
fix: add custom update interval in the user setting
Browse files Browse the repository at this point in the history
  • Loading branch information
lin.zhou committed Sep 30, 2018
1 parent 15b05b4 commit b176eb7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ log.transports.file.level = 'debug'
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html
*/
if (process.env.NODE_ENV !== 'development') {
global.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\')
global.__static = path.join(__dirname, '/static').replace(/\\/g, '\\\\')
}

log.info('node: ' + process.versions.node,
log.info(
'node: ' + process.versions.node,
'electron: ' + process.versions['atom-shell'],
'platform: ' + require('os').platform(),
'arch: ' + require('os').arch(),
'vue: ' + require('vue/package.json').version)

let mainWindow
Expand Down Expand Up @@ -199,9 +201,13 @@ app.on('ready', () => {
autoUpdater.checkForUpdates()
})

let timeout = 3600000
if (settings.has('updateInterval')) {
timeout = parseInt(settings.get('updateInterval'))
}

updateCheckTimer = setInterval(() => {
autoUpdater.checkForUpdatesAndNotify()
// }, 30000)
}, 3600000)
}, timeout)
}
})

0 comments on commit b176eb7

Please sign in to comment.