Clear backoff counter on new target state

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
Cameron Diver 2019-02-13 16:23:15 +00:00
parent 34397cc045
commit 5ace459ad2

View File

@ -342,6 +342,10 @@ module.exports = class DeviceState extends EventEmitter
Promise.using @_inferStepsLock, -> fn()
setTarget: (target, localSource = false) ->
# When we get a new target state, clear any built up apply errors
# This means that we can attempt to apply the new state instantly
@failedUpdates = 0
Promise.join(
@config.get('apiEndpoint'),
validateState(target),