mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-18 18:56:24 +00:00
Handle cancelDelay not being a function
Change-type: patch Closes: #1080 Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
c04ec45f96
commit
f4605d897e
@ -469,8 +469,10 @@ module.exports = class DeviceState extends EventEmitter
|
||||
if !@scheduledApply? || (isFromApi && @cancelDelay)
|
||||
@scheduledApply = { force, delay }
|
||||
if isFromApi
|
||||
# Cancel promise delay if call came from api to prevent waiting due to backoff
|
||||
@cancelDelay()
|
||||
# Cancel promise delay if call came from api to
|
||||
# prevent waiting due to backoff (and if we've
|
||||
# previously setup a delay)
|
||||
@cancelDelay?()
|
||||
else
|
||||
# If a delay has been set it's because we need to hold off before applying again,
|
||||
# so we need to respect the maximum delay that has been passed
|
||||
|
Loading…
Reference in New Issue
Block a user