fix(fs/outputStream): make path the first param

From #5373
This commit is contained in:
Julien Fontanet
2021-02-17 17:11:55 +01:00
parent 819c798e99
commit 7a13771198
2 changed files with 4 additions and 4 deletions

View File

@@ -209,8 +209,8 @@ export default class RemoteHandlerAbstract {
// write a stream to a file using a temporary file
async outputStream(
input: Readable | Promise<Readable>,
path: string,
input: Readable | Promise<Readable>,
{ checksum = true, dirMode }: { checksum?: boolean, dirMode?: number } = {}
): Promise<void> {
path = normalizePath(path)
@@ -477,7 +477,7 @@ export default class RemoteHandlerAbstract {
return this._outputFile(file, data, { flags })
}
async _outputStream(input: Readable, path: string, { checksum, dirMode }: { checksum?: boolean, dirMode?: number }) {
async _outputStream(path: string, input: Readable, { checksum, dirMode }: { checksum?: boolean, dirMode?: number }) {
const tmpPath = `${dirname(path)}/.${basename(path)}`
const output = await this.createOutputStream(tmpPath, {
checksum,

View File

@@ -1374,7 +1374,7 @@ export default class BackupNg {
parentId: taskId,
result: () => ({ size: xva.size }),
},
handler.outputStream(fork, dataFilename, {
handler.outputStream(dataFilename, fork, {
dirMode,
})
)
@@ -1712,7 +1712,7 @@ export default class BackupNg {
}
// FIXME: should only be renamed after the metadata file has been written
await handler.outputStream(fork.streams[`${id}.vhd`](), path, {
await handler.outputStream(path, fork.streams[`${id}.vhd`](), {
// no checksum for VHDs, because they will be invalidated by
// merges and chainings
checksum: false,