improve the logs
This commit is contained in:
@@ -209,7 +209,7 @@ async function downloadDir(backupTarget, remotePath, dataLayout, progressCallbac
|
||||
|
||||
const encryptedFilenames = backupTarget.encryption?.encryptedFilenames || false;
|
||||
|
||||
debug(`downloadDir: ${remotePath} to ${dataLayout.toString()}. encryption filenames: ${encryptedFilenames} content: ${!!backupTarget.encryption}`);
|
||||
debug(`downloadDir: ${remotePath} to ${dataLayout.toString()}. encryption filenames: ${encryptedFilenames}. encrypted files: ${!!backupTarget.encryption}`);
|
||||
|
||||
async function downloadFile(entry) {
|
||||
let relativePath = path.relative(remotePath, entry.path);
|
||||
@@ -224,6 +224,8 @@ async function downloadDir(backupTarget, remotePath, dataLayout, progressCallbac
|
||||
if (mkdirError) throw new BoxError(BoxError.FS_ERROR, mkdirError.message);
|
||||
|
||||
await promiseRetry({ times: 3, interval: 20000 }, async function () {
|
||||
progressCallback({ message: `Downloading ${entry.path} to ${destFilePath}` });
|
||||
|
||||
const [downloadError, sourceStream] = await safe(backupTargets.storageApi(backupTarget).download(backupTarget.config, entry.path));
|
||||
if (downloadError) {
|
||||
progressCallback({ message: `Download ${entry.path} to ${destFilePath} errored: ${downloadError.message}` });
|
||||
@@ -248,8 +250,6 @@ async function downloadDir(backupTarget, remotePath, dataLayout, progressCallbac
|
||||
|
||||
streams.push(destStream);
|
||||
|
||||
progressCallback({ message: `Downloading ${entry.path} to ${destFilePath}` });
|
||||
|
||||
const [pipelineError] = await safe(stream.pipeline(streams));
|
||||
if (pipelineError) {
|
||||
progressCallback({ message: `Download error ${entry.path} to ${destFilePath}: ${pipelineError.message}` });
|
||||
|
||||
Reference in New Issue
Block a user