no need for format specific getBackupFilePath

This commit is contained in:
Girish Ramakrishnan
2025-08-01 20:49:11 +02:00
parent ff6cbf6628
commit 7192439b2c
6 changed files with 25 additions and 38 deletions

View File

@@ -206,12 +206,11 @@ async function copy(backupTarget, srcRemotePath, destRemotePath, progressCallbac
assert.strictEqual(typeof destRemotePath, 'string');
assert.strictEqual(typeof progressCallback, 'function');
const { config, format } = backupTarget;
const oldFilePath = backupFormat.api(format).getBackupFilePath(backupTarget, srcRemotePath);
const newFilePath = backupFormat.api(format).getBackupFilePath(backupTarget, destRemotePath);
const oldFilePath = backupTargets.getBackupFilePath(backupTarget, srcRemotePath);
const newFilePath = backupTargets.getBackupFilePath(backupTarget, destRemotePath);
const startTime = new Date();
const [copyError] = await safe(backupTargets.storageApi(backupTarget).copy(config, oldFilePath, newFilePath, progressCallback));
const [copyError] = await safe(backupTargets.storageApi(backupTarget).copy(backupTarget.config, oldFilePath, newFilePath, progressCallback));
if (copyError) {
debug(`copy: copied to ${destRemotePath} errored. error: ${copyError.message}`);
throw copyError;