From f1a1b922c7071b8839de821126a98e112023eadc Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Tue, 11 Oct 2022 16:40:10 +0200 Subject: [PATCH] chore: format with Prettier --- @vates/fuse-vhd/index.js | 6 ++---- @xen-orchestra/backups/RemoteAdapter.js | 12 ++++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/@vates/fuse-vhd/index.js b/@vates/fuse-vhd/index.js index e9e41d12e..2fe7f0e41 100644 --- a/@vates/fuse-vhd/index.js +++ b/@vates/fuse-vhd/index.js @@ -57,9 +57,7 @@ exports.mount = Disposable.factory(async function* mount(handler, diskPath, moun }, read(path, fd, buf, len, pos, cb) { if (path === '/vhd0') { - return vhd - .readRawData(pos, len, cache, buf) - .then(cb) + return vhd.readRawData(pos, len, cache, buf).then(cb) } throw new Error(`read file ${path} not exists`) }, @@ -67,5 +65,5 @@ exports.mount = Disposable.factory(async function* mount(handler, diskPath, moun return new Disposable( () => fromCallback(() => fuse.unmount()), fromCallback(() => fuse.mount()) - ) + ) }) diff --git a/@xen-orchestra/backups/RemoteAdapter.js b/@xen-orchestra/backups/RemoteAdapter.js index 2eb922d60..7e301884e 100644 --- a/@xen-orchestra/backups/RemoteAdapter.js +++ b/@xen-orchestra/backups/RemoteAdapter.js @@ -76,14 +76,16 @@ const debounceResourceFactory = factory => } class RemoteAdapter { - constructor(handler, { debounceResource = res => res, dirMode, vhdDirectoryCompression, useGetDiskLegacy=false } = {}) { + constructor( + handler, + { debounceResource = res => res, dirMode, vhdDirectoryCompression, useGetDiskLegacy = false } = {} + ) { this._debounceResource = debounceResource this._dirMode = dirMode this._handler = handler this._vhdDirectoryCompression = vhdDirectoryCompression this._readCacheListVmBackups = synchronized.withKey()(this._readCacheListVmBackups) this._useGetDiskLegacy = useGetDiskLegacy - } get handler() { @@ -324,9 +326,7 @@ class RemoteAdapter { return this.#useVhdDirectory() } - async *#getDiskLegacy(diskId) { - const RE_VHDI = /^vhdi(\d+)$/ const handler = this._handler @@ -358,8 +358,8 @@ class RemoteAdapter { } async *getDisk(diskId) { - if(this._useGetDiskLegacy){ - yield * this.#getDiskLegacy(diskId) + if (this._useGetDiskLegacy) { + yield* this.#getDiskLegacy(diskId) return } const handler = this._handler