async function getBackupTemplate(shipKey, historyLogBlobDirectory, reportDataBlobDirectory) { const historyLogStreamPath = `${window.remote.app.getPath('userData')}/backupStream1.txt`; const reportDataStreamPath = `${window.remote.app.getPath('userData')}/backupStream2.txt`; const historyLog = await new Promise((resolve, reject) => { const stream = fs.createWriteStream(historyLogStreamPath); let historySummary = window.blobService.getBlobToStream(window.containerName, historyLogBlobDirectory, stream, async (err, text) => { console.log(historyLogStreamPath) console.log('historySummary1', historySummary) if (err) { if (err.statusCode === 403) { azureCustomService.setRequestDateHeaderFromAzureServerTimeStamp(err.message); await azureCustomService.communicateAzureWithCustomHeader('GET', window.containerName, historyLogBlobDirectory); try { azureCustomService.streamParsingToJSON(historyLogStreamPath, (err, data) => { resolve(JSON.parse(data)); }); } catch (e) { reject(e); } } } else { console.log('comp history', text) azureCustomService.streamParsingToJSON(historyLogStreamPath, (err, data) => { resolve(JSON.parse(data)); }); } }); console.log('historySummary2', historySummary) historySummary.on('progress', function() { var percentComplete = historySummary.getCompletePercent(2); var totalSize = historySummary.getTotalSize(true); console.log('Upload Complete3' + percentComplete); console.log('total: ' + totalSize); }); });----resultado----
Carga Completa3 (%): 100.00
total: 4.61KB
Quiero obtener el progreso de la descarga en tiempo real
pero viene solo una vez después de completar la conexión.
como puedo hacer??