rsync: bump empty dir limit to 80k

This commit is contained in:
Girish Ramakrishnan
2025-11-24 12:06:52 +01:00
parent ae2f74777b
commit 9e82839fb7
+2 -2
View File
@@ -155,8 +155,8 @@ async function saveFsMetadata(dataLayout, metadataFile) {
// we assume small number of files. spawnSync will raise a ENOBUFS error after maxBuffer
for (const lp of dataLayout.localPaths()) {
const [emptyDirsError, emptyDirs] = await safe(shell.spawn('find', [lp, '-type', 'd', '-empty'], { encoding: 'utf8', maxLines: 50000 }));
if (emptyDirsError && emptyDirsError.stdoutLineCount >= 50000) throw new BoxError(BoxError.FS_ERROR, `Too many empty directories. Run "find ${lp} -type d -empty" to investigate`);
const [emptyDirsError, emptyDirs] = await safe(shell.spawn('find', [lp, '-type', 'd', '-empty'], { encoding: 'utf8', maxLines: 80000 }));
if (emptyDirsError && emptyDirsError.stdoutLineCount >= 80000) throw new BoxError(BoxError.FS_ERROR, `Too many empty directories. Run "find ${lp} -type d -empty" to investigate`);
if (emptyDirsError) throw emptyDirsError;
if (emptyDirs.length) metadata.emptyDirs = metadata.emptyDirs.concat(emptyDirs.trim().split('\n').map((ed) => dataLayout.toRemotePath(ed)));