Skip to content

Commit 478fb6f

Browse files
committed
fix: add sleep between file processing in Ignore and Zip classes
1 parent 19d36d5 commit 478fb6f

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/structures/filesystem/ignore.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { readFile } from "fs/promises";
33
import { glob } from "glob";
44
import { globifyGitIgnore } from "globify-gitignore";
55
import { dirname } from "path";
6+
import { setTimeout as sleep } from "timers/promises";
67
import { IGNORE_FILENAME } from "../../utils/constants";
78
import { joinWithRoot } from "../../utils/path";
89

@@ -14,6 +15,7 @@ export default class Ignore {
1415

1516
for (let i = 0; i < result.length; i++) {
1617
patterns.push(result[i].glob);
18+
await sleep();
1719
}
1820

1921
return patterns;

src/structures/filesystem/zip.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import AdmZip from "adm-zip";
22
import { join } from "path";
3+
import { setTimeout as sleep } from "timers/promises";
34
import { type IZip } from "../../interfaces/zip";
45

56
export default class Zip implements IZip {
@@ -20,6 +21,8 @@ export default class Zip implements IZip {
2021
const file = files[i];
2122

2223
this.zip.addLocalFile(join(cwd, file), void 0, file);
24+
25+
await sleep();
2326
}
2427
}
2528

0 commit comments

Comments
 (0)