From c8a7c49cd523e8b8876ae6418bb02c34b250cf6c Mon Sep 17 00:00:00 2001 From: Pagan Gazzard Date: Tue, 14 Oct 2014 11:38:50 +0100 Subject: [PATCH] Move the application update poll interval to an env var and reduce to 60s. --- src/app.coffee | 4 ++-- src/config.coffee | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app.coffee b/src/app.coffee index 5c8b400a..f10897be 100644 --- a/src/app.coffee +++ b/src/app.coffee @@ -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 = -> diff --git a/src/config.coffee b/src/config.coffee index e7fdddf4..c8bee792 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -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'