mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:06:56 -04:00
fix issues with 2,000,000 files being uploaded
This commit is contained in:
parent
3a03667a44
commit
72dc676cb8
@ -127,7 +127,11 @@ export const checkForDuplicates = async (files: string[], { concurrency, skipHas
|
|||||||
|
|
||||||
while (retries < maxRetries) {
|
while (retries < maxRetries) {
|
||||||
try {
|
try {
|
||||||
const response = await checkBulkUpload({ assetBulkUploadCheckDto: { assets: results } });
|
const chunks = chunk(results, 1000);
|
||||||
|
|
||||||
|
await Promise.all(
|
||||||
|
chunks.map(async (chunk) => {
|
||||||
|
const response = await checkBulkUpload({ assetBulkUploadCheckDto: { assets: chunk } });
|
||||||
|
|
||||||
for (const { id: filepath, assetId, action } of response.results) {
|
for (const { id: filepath, assetId, action } of response.results) {
|
||||||
if (action === Action.Accept) {
|
if (action === Action.Accept) {
|
||||||
@ -137,7 +141,8 @@ export const checkForDuplicates = async (files: string[], { concurrency, skipHas
|
|||||||
duplicates.push({ id: assetId as string, filepath });
|
duplicates.push({ id: assetId as string, filepath });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}),
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
retries++;
|
retries++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user