Set default delta apply timeout of 0

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
Cameron Diver 2019-02-08 15:54:34 +00:00
parent d19e63d38f
commit 88f19b4147
No known key found for this signature in database
GPG Key ID: 49690ED87032539F
4 changed files with 7 additions and 14 deletions

View File

@ -122,7 +122,7 @@ export const schemaTypes = {
},
deltaApplyTimeout: {
type: PermissiveNumber,
default: NullOrUndefined,
default: 0,
},
deltaRetryCount: {
type: PermissiveNumber,
@ -232,7 +232,7 @@ export const schemaTypes = {
deltaEndpoint: t.string,
delta: PermissiveBoolean,
deltaRequestTimeout: PermissiveNumber,
deltaApplyTimeout: t.union([PermissiveNumber, NullOrUndefined]),
deltaApplyTimeout: PermissiveNumber,
deltaRetryCount: PermissiveNumber,
deltaRetryInterval: PermissiveNumber,
deltaVersion: PermissiveNumber,

View File

@ -95,7 +95,7 @@ export class DeviceConfig {
deltaApplyTimeout: {
envVarName: 'SUPERVISOR_DELTA_APPLY_TIMEOUT',
varType: 'int',
defaultValue: '',
defaultValue: '0',
},
deltaRetryCount: {
envVarName: 'SUPERVISOR_DELTA_RETRY_COUNT',

View File

@ -9,9 +9,8 @@ import { SchemaReturn } from '../config/schema-type';
import { envArrayToObject } from './conversions';
import {
DeltaStillProcessingError,
InternalInconsistencyError,
InvalidNetGatewayError,
ImageAuthenticationError,
InvalidNetGatewayError,
} from './errors';
import { request, requestLib, resumable } from './request';
import { EnvVarObject } from './types';
@ -64,12 +63,6 @@ export class DockerUtils extends DockerToolbelt {
const timeout = deltaOpts.deltaApplyTimeout;
if (timeout == null) {
throw new InternalInconsistencyError(
'A delta apply timeout is not set in fetchDeltaWithProgress!',
);
}
const log = (str: string) =>
console.log(`delta(${deltaOpts.deltaSource}): ${str}`);

View File

@ -16,7 +16,7 @@ DeviceState = require '../src/device-state'
mockedInitialConfig = {
'RESIN_SUPERVISOR_CONNECTIVITY_CHECK': 'true'
'RESIN_SUPERVISOR_DELTA': 'false'
'RESIN_SUPERVISOR_DELTA_APPLY_TIMEOUT': ''
'RESIN_SUPERVISOR_DELTA_APPLY_TIMEOUT': '0'
'RESIN_SUPERVISOR_DELTA_REQUEST_TIMEOUT': '30000'
'RESIN_SUPERVISOR_DELTA_RETRY_COUNT': '30'
'RESIN_SUPERVISOR_DELTA_RETRY_INTERVAL': '10000'
@ -35,7 +35,7 @@ testTarget1 = {
'HOST_CONFIG_gpu_mem': '256'
'SUPERVISOR_CONNECTIVITY_CHECK': 'true'
'SUPERVISOR_DELTA': 'false'
'SUPERVISOR_DELTA_APPLY_TIMEOUT': ''
'SUPERVISOR_DELTA_APPLY_TIMEOUT': '0'
'SUPERVISOR_DELTA_REQUEST_TIMEOUT': '30000'
'SUPERVISOR_DELTA_RETRY_COUNT': '30'
'SUPERVISOR_DELTA_RETRY_INTERVAL': '10000'
@ -117,7 +117,7 @@ testTargetWithDefaults2 = {
'HOST_CONFIG_gpu_mem': '512'
'SUPERVISOR_CONNECTIVITY_CHECK': 'true'
'SUPERVISOR_DELTA': 'false'
'SUPERVISOR_DELTA_APPLY_TIMEOUT': ''
'SUPERVISOR_DELTA_APPLY_TIMEOUT': '0'
'SUPERVISOR_DELTA_REQUEST_TIMEOUT': '30000'
'SUPERVISOR_DELTA_RETRY_COUNT': '30'
'SUPERVISOR_DELTA_RETRY_INTERVAL': '10000'