mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-04-16 23:38:52 +00:00
Merge pull request #2408 from balena-os/fix-socket-timeout
Ensure poll socket timeout is defined early
This commit is contained in:
commit
175872b358
@ -3,6 +3,7 @@ import url from 'url';
|
||||
import { setTimeout } from 'timers/promises';
|
||||
import Bluebird from 'bluebird';
|
||||
import type StrictEventEmitter from 'strict-event-emitter-types';
|
||||
import { Agent } from 'https';
|
||||
|
||||
import type { TargetState } from '../types/state';
|
||||
import { InternalInconsistencyError } from '../lib/errors';
|
||||
@ -120,6 +121,13 @@ export const update = async (
|
||||
const got = await getGotInstance();
|
||||
|
||||
const { statusCode, headers, body } = await got(endpoint, {
|
||||
retry: { limit: 0 },
|
||||
agent: {
|
||||
https: new Agent({
|
||||
keepAlive: true,
|
||||
timeout: apiRequestTimeout,
|
||||
}),
|
||||
},
|
||||
headers: {
|
||||
Authorization: `Bearer ${deviceApiKey}`,
|
||||
'If-None-Match': cache?.etag,
|
||||
|
Loading…
x
Reference in New Issue
Block a user