Merge pull request #1466 from balena-io/1428-patch-variable-is-set

Correctly evaluate if scheduledApply.delay is not set
This commit is contained in:
bulldozer-balena[bot] 2020-09-25 18:02:21 +00:00 committed by GitHub
commit eaff2ac801
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -854,7 +854,10 @@ export function triggerApplyTarget({
// 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
if (!scheduledApply.delay) {
if (scheduledApply.delay === undefined || isNaN(scheduledApply.delay)) {
log.debug(
`Tried to apply target with invalid delay: ${scheduledApply.delay}`,
);
throw new InternalInconsistencyError(
'No delay specified in scheduledApply',
);