mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-24 15:56:40 +00:00
Merge pull request #1119 from balena-io/1117-vpn-rate-limit-fix
Ensure that we reset rate limits after a successful target apply
This commit is contained in:
commit
b64c5345a9
@ -324,6 +324,12 @@ export class DeviceConfig {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public resetRateLimits() {
|
||||||
|
_.each(this.rateLimits, action => {
|
||||||
|
action.lastAttempt = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private bootConfigChangeRequired(
|
private bootConfigChangeRequired(
|
||||||
configBackend: DeviceConfigBackend | null,
|
configBackend: DeviceConfigBackend | null,
|
||||||
current: Dictionary<string>,
|
current: Dictionary<string>,
|
||||||
|
@ -146,6 +146,10 @@ module.exports = class DeviceState extends EventEmitter
|
|||||||
log.error('Device state apply error', err)
|
log.error('Device state apply error', err)
|
||||||
else
|
else
|
||||||
log.success('Device state apply success')
|
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)
|
@applications.on('change', @reportCurrentState)
|
||||||
|
|
||||||
healthcheck: =>
|
healthcheck: =>
|
||||||
|
Loading…
Reference in New Issue
Block a user