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
parent
963862b1b9
commit
afa836181c
|
|
@ -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());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue