fix(cli): prevent out-of-memory on file upload due to undici storing the request body (#28723)

fix(cli): add fetch param to prevent OOM of upload

Issue due to undici storing the entire request body in memory.
Related undici bug report: https://github.com/nodejs/undici/issues/4058

Fixes https://github.com/immich-app/immich/issues/28720

Signed-off-by: moversity <148445403+moversity@users.noreply.github.com>
pull/27919/head
moversity 2026-06-03 15:19:35 +00:00 committed by GitHub
parent 963862b1b9
commit afa836181c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -426,6 +426,8 @@ const uploadFile = async (input: string, stats: Stats): Promise<AssetMediaRespon
redirect: 'error', redirect: 'error',
headers: headers as Record<string, string>, headers: headers as Record<string, string>,
body: formData, body: formData,
// eslint-disable-next-line unicorn/no-null
window: null,
}); });
if (response.status !== 200 && response.status !== 201) { if (response.status !== 200 && response.status !== 201) {
throw new Error(await response.text()); throw new Error(await response.text());