From fbacd0c2b6c7c62a0d35a05369576d824f6a2c3a Mon Sep 17 00:00:00 2001 From: Sebastian Rieger Date: Wed, 6 Sep 2023 18:12:35 +0000 Subject: [PATCH] removed unused vars, linting --- backend/src/providers/FirecrackerProvider.ts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/backend/src/providers/FirecrackerProvider.ts b/backend/src/providers/FirecrackerProvider.ts index 493a2ed..1597dfd 100644 --- a/backend/src/providers/FirecrackerProvider.ts +++ b/backend/src/providers/FirecrackerProvider.ts @@ -111,10 +111,8 @@ class microVM { ); } - const microVM = this; - - this.microVMInstance.process.on("exit", async function (code, signal) { - await fs.unlink(microVM.socketPath).catch(async (err) => { + this.microVMInstance.process.on("exit", async function () { + await fs.unlink(this.socketPath).catch(async (err) => { if ("ENOENT" !== err.code) { return reject( new Error( @@ -124,11 +122,11 @@ class microVM { } // if ENOENT, file does not exist as intended }); - microVM.microVMInstance.process = undefined; + this.microVMInstance.process = undefined; }); - this.microVMInstance.process.on("close", async function (code, signal) { - await fs.unlink(microVM.socketPath).catch(async (err) => { + this.microVMInstance.process.on("close", async function () { + await fs.unlink(this.socketPath).catch(async (err) => { if ("ENOENT" !== err.code) { return reject( new Error( @@ -138,11 +136,11 @@ class microVM { } // if ENOENT, file does not exist as intended }); - microVM.microVMInstance.process = undefined; + this.microVMInstance.process = undefined; }); - this.microVMInstance.process.on("error", async function (err) { - await fs.unlink(microVM.socketPath).catch(async (err) => { + this.microVMInstance.process.on("error", async function () { + await fs.unlink(this.socketPath).catch(async (err) => { if ("ENOENT" !== err.code) { return reject( new Error( @@ -785,4 +783,4 @@ export default class FirecrackerProvider implements InstanceProvider { setTimeout(resolve, ms); }); } -} \ No newline at end of file +}