Move the application update poll interval to an env var and reduce to 60s.

This commit is contained in:
Pagan Gazzard 2014-10-14 11:38:50 +01:00 committed by Pablo Carranza Vélez
parent c7c1c45f38
commit c8a7c49cd5
2 changed files with 3 additions and 2 deletions

View File

@ -77,10 +77,10 @@ knex('config').select('value').where(key: 'uuid').then ([ uuid ]) ->
.catch (error) ->
console.error('Error starting apps:', error)
.then ->
console.log('Starting periodic check for updates..')
utils.mixpanelTrack('Start application update poll', {interval: config.appUpdatePollInterval})
setInterval(->
application.update()
, 5 * 60 * 1000) # Every 5 mins
, config.appUpdatePollInterval)
application.update()
updateIpAddr = ->

View File

@ -20,6 +20,7 @@ module.exports = config =
ledFile: process.env.LED_FILE ? '/sys/class/leds/led0/brightness'
bootstrapRetryDelay: checkInt(process.env.BOOTSTRAP_RETRY_DELAY_MS) ? 30000
restartSuccessTimeout: checkInt(process.env.RESTART_SUCCESS_TIMEOUT) ? 60000
appUpdatePollInterval: checkInt(process.env.APPLICATION_UPDATE_POLL_INTERVAL) ? 60000
successMessage: 'SUPERVISOR OK'
config.heartbeatEndpoint = config.apiEndpoint + '/ping'