feat(backups/RemoteAdapter#outputStream): make path first param

Similar to `fs/Abstract#outputStream()`.
This commit is contained in:
Julien Fontanet
2021-02-23 12:34:26 +01:00
parent ca5af2505c
commit eff2d48cc5
4 changed files with 4 additions and 4 deletions

View File

@@ -507,7 +507,7 @@ exports.RemoteAdapter = class RemoteAdapter {
return backups.sort(compareTimestamp)
}
async outputStream(input, path, { checksum = true, validator = noop } = {}) {
async outputStream(path, input, { checksum = true, validator = noop } = {}) {
const handler = this._handler
input = await input
const tmpPath = `${dirname(path)}/.${basename(path)}`

View File

@@ -173,7 +173,7 @@ exports.DeltaBackupWriter = class DeltaBackupWriter {
await checkVhd(handler, parentPath)
}
await adapter.outputStream(deltaExport.streams[`${id}.vhd`], path, {
await adapter.outputStream(path, deltaExport.streams[`${id}.vhd`], {
// no checksum for VHDs, because they will be invalidated by
// merges and chainings
checksum: false,

View File

@@ -67,7 +67,7 @@ exports.FullBackupWriter = class FullBackupWriter {
}
await Task.run({ name: 'transfer' }, async () => {
await adapter.outputStream(stream, dataFilename, {
await adapter.outputStream(dataFilename, stream, {
validator: tmpPath => {
if (handler._getFilePath !== undefined) {
return isValidXva(handler._getFilePath('/' + tmpPath))

View File

@@ -62,7 +62,7 @@ exports.PoolMetadataBackup = class PoolMetadataBackup {
},
async () => {
// forkStreamUnpipe should be used in a sync way, do not wait for a promise before using it
await adapter.outputStream(forkStreamUnpipe(stream), fileName, { checksum: false })
await adapter.outputStream(fileName, forkStreamUnpipe(stream), { checksum: false })
await adapter.handler.outputFile(metaDataFileName, metadata, {
dirMode: this._config.dirMode,
})