Add timeouts for TUS uploads

This commit is contained in:
trevor-signal
2026-01-06 13:26:58 -05:00
committed by GitHub
parent 18c21e5959
commit 413ec4b7ac
2 changed files with 9 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ import { createLogger } from '../../logging/log.std.js';
import * as Errors from '../../types/errors.std.js';
import { sleep } from '../sleep.std.js';
import { FIBONACCI_TIMEOUTS, BackOff } from '../BackOff.std.js';
import { MINUTE } from '../durations/constants.std.js';
const log = createLogger('tusProtocol');
@@ -129,6 +130,7 @@ export async function _tusCreateWithUploadRequest({
}),
'Content-Type': 'application/offset+octet-stream',
},
timeout: MINUTE,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
body: readable as any,
}),
@@ -256,6 +258,7 @@ export async function _tusResumeUploadRequest({
'Upload-Offset': String(uploadOffset),
'Content-Type': 'application/offset+octet-stream',
},
timeout: MINUTE,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
body: readable as any,
}),