diff --git a/src/device-config.ts b/src/device-config.ts index 9157a9c2..e15f6328 100644 --- a/src/device-config.ts +++ b/src/device-config.ts @@ -324,6 +324,12 @@ export class DeviceConfig { ); } + public resetRateLimits() { + _.each(this.rateLimits, action => { + action.lastAttempt = null; + }); + } + private bootConfigChangeRequired( configBackend: DeviceConfigBackend | null, current: Dictionary, diff --git a/src/device-state.coffee b/src/device-state.coffee index 88b4fd97..89ab51aa 100644 --- a/src/device-state.coffee +++ b/src/device-state.coffee @@ -146,6 +146,10 @@ module.exports = class DeviceState extends EventEmitter log.error('Device state apply error', err) else log.success('Device state apply success') + # We also let the device-config module know that we + # successfully reached the target state and that it + # should clear any rate limiting it's applied + @deviceConfig.resetRateLimits() @applications.on('change', @reportCurrentState) healthcheck: =>