retry download only 3 times

This commit is contained in:
Girish Ramakrishnan
2025-10-07 20:42:04 +02:00
parent 2ba0d716d1
commit 505c71855e
2 changed files with 12 additions and 12 deletions

View File

@@ -1,16 +1,5 @@
'use strict';
exports = module.exports = {
download,
upload,
verify,
getFileExtension,
copy,
_saveFsMetadata: saveFsMetadata,
_restoreFsMetadata: restoreFsMetadata
};
const assert = require('node:assert'),
async = require('async'),
backupSites = require('../backupsites.js'),
@@ -382,3 +371,14 @@ async function verify(backupSite, remotePath, integrityMap, progressCallback) {
sha256: { status: 'passed' },
};
}
exports = module.exports = {
download,
upload,
verify,
getFileExtension,
copy,
_saveFsMetadata: saveFsMetadata,
_restoreFsMetadata: restoreFsMetadata
};

View File

@@ -245,7 +245,7 @@ async function download(backupSite, remotePath, dataLayout, progressCallback) {
debug(`download: Downloading ${remotePath} to ${dataLayout.toString()}`);
await promiseRetry({ times: 5, interval: 20000, debug }, async () => {
await promiseRetry({ times: 3, interval: 20000, debug }, async () => {
progressCallback({ message: `Downloading backup ${remotePath}` });
const sourceStream = await backupSites.storageApi(backupSite).download(backupSite.config, remotePath);