diff --git a/packages/database/src/DatabaseService.ts b/packages/database/src/DatabaseService.ts index 06e1d18..19536a7 100644 --- a/packages/database/src/DatabaseService.ts +++ b/packages/database/src/DatabaseService.ts @@ -39,7 +39,7 @@ export class DatabaseService extends Inte /** * Boot the database service */ - public async boot() { + public override async boot() { let password = await secret(DB.DATABASE_PASSWORD_FILE); let database = env("DATABASE"); this.connection = await this.connectToDatabase( @@ -56,7 +56,7 @@ export class DatabaseService extends Inte /** * Shutdown the database service */ - public async shutdown() { + public override async shutdown() { await this.connection.close(); } diff --git a/packages/webserver/src/WebServerService.ts b/packages/webserver/src/WebServerService.ts index 5f42e7d..412959f 100644 --- a/packages/webserver/src/WebServerService.ts +++ b/packages/webserver/src/WebServerService.ts @@ -31,7 +31,7 @@ export abstract class WebServerService ex /** * Boot the webserver */ - public async boot() { + public override async boot() { // Create the Fastify instance this.fastify = fastify(); @@ -45,7 +45,7 @@ export abstract class WebServerService ex /** * Start the webserver */ - public start() { + public override start() { // Start listening this.fastify.listen(this.PORT, "0.0.0.0"); this.log("Webserver listening on port:", this.PORT); @@ -54,7 +54,7 @@ export abstract class WebServerService ex /** * Shutdown the webserver */ - public async shutdown() { + public override async shutdown() { this.log("Webserver shutting down"); await this.fastify.close(); } diff --git a/packages/websocket-server/src/WebSocketServerService.ts b/packages/websocket-server/src/WebSocketServerService.ts index db11493..6f50a0d 100644 --- a/packages/websocket-server/src/WebSocketServerService.ts +++ b/packages/websocket-server/src/WebSocketServerService.ts @@ -19,7 +19,7 @@ export abstract class WebSocketServerService extends Int /** * The list of registered methods */ - #methods: { [method: string]: (payload?: any) => Promise|any } = {}; + private __methods: { [method: string]: (payload?: any) => Promise|any } = {}; // Overridable --------------------------------------------------------------------------------- @@ -111,10 +111,10 @@ export abstract class WebSocketServerService extends Int * Install a method into the server service */ protected installMethod(name: string, method: (payload?: any) => Promise|any) { - if (this.#methods[name] !== undefined) { + if (this.__methods[name] !== undefined) { throw new Error("Attempted to install method with duplicate name in websocket service"); } - this.#methods[name] = method; + this.__methods[name] = method; } // Event Handling ------------------------------------------------------------------------------ @@ -123,11 +123,11 @@ export abstract class WebSocketServerService extends Int * Handle an incoming request */ protected async handleRequest(socket: WebSocket, request: IWebSocketRequest) { - if (this.#methods[request.method] === undefined) { + if (this.__methods[request.method] === undefined) { console.warn(`Requested unknown method: '${request.method}' with payload:`, request.payload); return; } - let result = await this.#methods[request.method](request.payload); + let result = await this.__methods[request.method](request.payload); socket.send(JSON.stringify({ type: "response", requestId: request.requestId,