Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
share121 committed Feb 7, 2025
1 parent 64387ac commit 58b5392
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
7 changes: 0 additions & 7 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export async function download({
headers = {},
startChunk = 0,
endChunk = Infinity,
}: DownloadOptions) {
}: DownloadOptions) {
async function getURLInfo() {
while (true) {
Expand Down Expand Up @@ -62,15 +61,11 @@ export async function download({
start: startChunk + i * chunkSize,
end: startChunk + Math.min((i + 1) * chunkSize, contentLength) - 1,
}));
await downloadChunk({
threadCount: threads,
await downloadChunk({
threadCount: threads,
url,
headers,
data: chunks,
onProgress: async (i) => {
data: chunks,
onProgress: async (i) => {
const release = await mutex.acquire();
while (true) {
Expand All @@ -87,8 +82,6 @@ export async function download({
console.log(`chunk ${i.origin.start} - ${i.origin.end} done`);
},
maxRetries: Infinity,
});
maxRetries: Infinity,
});
await mutex.waitForUnlock();
} finally {
Expand Down
1 change: 0 additions & 1 deletion worker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Chunk } from "./workerpool.ts";
import type { Chunk } from "./workerpool.ts";

export interface FetchChunksOptions {
url: string;
Expand Down

0 comments on commit 58b5392

Please sign in to comment.