backup: add retry only if > 1

This commit is contained in:
Girish Ramakrishnan
2019-01-11 11:06:32 -08:00
parent ea3cc9b153
commit c021d3d9ce

View File

@@ -331,8 +331,8 @@ function sync(backupConfig, backupId, dataDir, progressCallback, callback) {
retryCallback = once(retryCallback); // protect again upload() erroring much later after read stream error
++retryCount;
progressCallback({ message: `${task.operation} ${task.path} try ${retryCount}` });
if (task.operation === 'add') {
progressCallback({ message: `Adding ${task.path}` + (retryCount > 1 ? ` (Try ${retryCount})` : '') });
debug(`Adding ${task.path} position ${task.position} try ${retryCount}`);
var stream = createReadStream(path.join(dataDir, task.path), backupConfig.key || null);
stream.on('error', function (error) {