Skip to content

Commit 83dfe2b

Browse files
fix(file-share): allow slower large-file chunk lookup (#60)
1 parent af6fcb4 commit 83dfe2b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/file-share/library/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ const LARGE_FILE_SEGMENT_SIZE = TINY_FILE_SIZE_LIMIT / 10;
124124
const LARGE_FILE_TARGET_CHUNK_COUNT = 1024;
125125
const CHUNK_SIZE_GRANULARITY = 64 * 1024;
126126
const MAX_LARGE_FILE_SEGMENT_SIZE = TINY_FILE_SIZE_LIMIT - 256 * 1024;
127+
const LARGE_FILE_CHUNK_LOOKUP_TIMEOUT_MS = 5 * 60 * 1000;
127128
const TINY_FILE_SIZE_LIMIT_BIGINT = BigInt(TINY_FILE_SIZE_LIMIT);
128129

129130
const roundUpTo = (value: number, multiple: number) =>
@@ -339,7 +340,8 @@ export class LargeFile extends AbstractFile {
339340
timeout?: number;
340341
}
341342
): Promise<TinyFile> {
342-
const totalTimeout = properties?.timeout ?? 30_000;
343+
const totalTimeout =
344+
properties?.timeout ?? LARGE_FILE_CHUNK_LOOKUP_TIMEOUT_MS;
343345
const deadline = Date.now() + totalTimeout;
344346
const attemptTimeout = Math.min(totalTimeout, 5_000);
345347
const chunkId = getChunkId(this.id, index);

0 commit comments

Comments
 (0)