mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-20 06:07:57 +00:00
Move the starting timeout to a config var.
This commit is contained in:
parent
2210b1be29
commit
2d8df956a6
@ -10,6 +10,7 @@ module.exports = config =
|
||||
configMountPoint: process.env.CONFIG_MOUNT_POINT ? '/mnt/mmcblk0p1/config.json'
|
||||
ledFile: process.env.LED_FILE ? '/sys/class/leds/led0/brightness'
|
||||
bootstrapRetryDelay: process.env.BOOTSTRAP_RETRY_DELAY_MS ? 30000
|
||||
restartSuccessTimeout: process.env.RESTART_SUCCESS_TIMEOUT ? 60000
|
||||
successMessage: 'SUPERVISOR OK'
|
||||
|
||||
config.heartbeatEndpoint = config.apiEndpoint + '/ping'
|
||||
|
@ -57,10 +57,10 @@ startNewSupervisor = (currentSupervisor, waitForSuccess = true) ->
|
||||
)
|
||||
stream.on 'end', ->
|
||||
reject(new Error('New supervisor stopped before success message'))
|
||||
.timeout(60000) # wait up to 1 minute
|
||||
.timeout(config.restartSuccessTimeout) # wait up to 1 minute
|
||||
.catch (e) ->
|
||||
container.stopAsync()
|
||||
console.log('Container failed to start successfully. Error: ', e)
|
||||
console.error('Container failed to start successfully. Error: ', e)
|
||||
throw e
|
||||
.then ->
|
||||
# We've started the new container, so we're done here! #pray
|
||||
|
Loading…
Reference in New Issue
Block a user