feat(backups/RemoteAdapter#outputStream): make path first param
Similar to `fs/Abstract#outputStream()`.
This commit is contained in:
@@ -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)}`
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user