Skip to content

Commit 62337fd

Browse files
committed
fix(MongoBinaryDownload): force an status print on download finish
1 parent d72ed42 commit 62337fd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/mongodb-memory-server-core/src/util/MongoBinaryDownload.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,8 @@ export class MongoBinaryDownload {
414414
return;
415415
}
416416

417+
this.printDownloadProgress({ length: 0 }, true);
418+
417419
fileStream.close();
418420
await fspromises.rename(tempDownloadLocation, downloadLocation);
419421
log(`httpDownload: moved "${tempDownloadLocation}" to "${downloadLocation}"`);
@@ -437,12 +439,12 @@ export class MongoBinaryDownload {
437439
* Print the Download Progress to STDOUT
438440
* @param chunk A chunk to get the length
439441
*/
440-
printDownloadProgress(chunk: { length: number }): void {
442+
printDownloadProgress(chunk: { length: number }, forcePrint: boolean = false): void {
441443
this.dlProgress.current += chunk.length;
442444

443445
const now = Date.now();
444446

445-
if (now - this.dlProgress.lastPrintedAt < 2000) {
447+
if (now - this.dlProgress.lastPrintedAt < 2000 && !forcePrint) {
446448
return;
447449
}
448450

0 commit comments

Comments
 (0)