Skip to content

Commit dfcc106

Browse files
committed
MILAB-3078: drivers: download: big files fix
1 parent 5350ba4 commit dfcc106

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changeset/slick-dots-obey.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@milaboratories/pl-drivers': patch
3+
---
4+
5+
drivers: download: fix big files downloading

lib/node/pl-drivers/src/drivers/download_blob/download_blob_task.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ export class DownloadBlobTask {
7373
}
7474
}
7575

76-
private async ensureDownloaded() {
76+
/**
77+
* If the blob is downloaded, just returns it's size.
78+
* If the blob is not downloaded, downloads it, writes it to the disk atomically and returns the size.
79+
* Has a signal to cancel the task and a state to print it if something goes wrong.
80+
*/
81+
private async ensureDownloaded(): Promise<number> {
7782
this.signalCtl.signal.throwIfAborted();
7883

7984
this.state = {};

0 commit comments

Comments
 (0)