From 253e22b9d60be14ba15f1225479a01ceee7ffd77 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Fri, 6 Jul 2018 00:05:19 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Do=20not=20read=20from=20disk=20?= =?UTF-8?q?until=20files=20have=20been=20written?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ssn/getPatch.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ssn/getPatch.ts b/src/ssn/getPatch.ts index a99f379..df87e6f 100644 --- a/src/ssn/getPatch.ts +++ b/src/ssn/getPatch.ts @@ -32,6 +32,9 @@ export default async function getPatch(product: Product, from: number, to: numbe //Then we need to wait for disks to finish download before we can extract individual files //TODO: we can optimize this to already extract some files as soon as their relevant parts are downloaded const diskFilenames = await Promise.all(diskFiles); + console.log('Waiting for everything to be written to disk...'); + await new Promise((resolve) => { setTimeout(resolve, 15000); }); + console.log('Done!'); //const dvArray = bufferArray.map((buffer) => new DataView(buffer)); //TODO: Verify that downloaded files match the hash in `solidpkg.pieces`