From fce43dc18c96b35034f0c4e446414e6ce1baae47 Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Sun, 2 May 2021 22:31:55 -0500 Subject: [PATCH] Change socket path in IPC services to use a constant rather than a getter in the microservice IPC package --- packages/microservice/src/ipc/AbstractIpcService.ts | 2 +- packages/microservice/src/ipc/IpcClientService.ts | 2 +- packages/microservice/src/ipc/IpcServerService.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/microservice/src/ipc/AbstractIpcService.ts b/packages/microservice/src/ipc/AbstractIpcService.ts index e48f4e1..766b4e1 100644 --- a/packages/microservice/src/ipc/AbstractIpcService.ts +++ b/packages/microservice/src/ipc/AbstractIpcService.ts @@ -18,7 +18,7 @@ export default abstract class AbstractIpcService ex public bootIpc(ipc: IPC) { // Connect to the server return new Promise((resolve, reject) => { - this.rawIpcInstance!.connectTo(this.NAME, this.socketPath, () => { + this.rawIpcInstance!.connectTo(this.NAME, this.SOCKET_PATH, () => { this.__isConnected = true; this.__requestId = 0; this.__socket = ipc!.of[this.NAME]; diff --git a/packages/microservice/src/ipc/IpcServerService.ts b/packages/microservice/src/ipc/IpcServerService.ts index 553a74e..3edac80 100644 --- a/packages/microservice/src/ipc/IpcServerService.ts +++ b/packages/microservice/src/ipc/IpcServerService.ts @@ -35,9 +35,9 @@ export abstract class IpcServerService ex public bootIpc(ipc: IPC) { return new Promise(async (resolve) => { // Create the socket directory if it doesn't exist - await mkdir(dirname(this.socketPath), { recursive: true }); + await mkdir(dirname(this.SOCKET_PATH), { recursive: true }); // Serve the IPC server - ipc.serve(this.socketPath, () => { + ipc.serve(this.SOCKET_PATH, () => { this.__server = ipc.server; this.installMessageHandlers(); resolve();