mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-06-02 07:40:48 +00:00
Show better logs for UpdatesLockedError
Change-type: patch Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
5ace459ad2
commit
5894a9baf3
@ -132,6 +132,7 @@ module.exports = class DeviceState extends EventEmitter
|
||||
@router = createDeviceStateRouter(this)
|
||||
@on 'apply-target-state-end', (err) ->
|
||||
if err?
|
||||
if not (err instanceof UpdatesLockedError)
|
||||
console.log("Apply error #{err}")
|
||||
else
|
||||
console.log('Apply success!')
|
||||
@ -577,10 +578,14 @@ module.exports = class DeviceState extends EventEmitter
|
||||
@failedUpdates += 1
|
||||
@reportCurrentState(update_failed: true)
|
||||
if @scheduledApply?
|
||||
if not (err instanceof UpdatesLockedError)
|
||||
console.log("Updating failed, but there's another update scheduled immediately: ", err)
|
||||
else
|
||||
delay = Math.min((2 ** @failedUpdates) * constants.backoffIncrement, @maxPollTime)
|
||||
# If there was an error then schedule another attempt briefly in the future.
|
||||
if err instanceof UpdatesLockedError
|
||||
console.log("Updates are locked, retrying in #{delay}ms...")
|
||||
else
|
||||
console.log('Scheduling another update attempt due to failure: ', delay, err)
|
||||
@triggerApplyTarget({ force, delay, initial })
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user