Browse Source

Add SIGINT handler in microservice package. Add better error logging for failed boot

dev
David Ludwig 4 years ago
parent
commit
4b0c76d400
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      packages/microservice/src/Microservice.ts

+ 2
- 1
packages/microservice/src/Microservice.ts View File

@ -111,12 +111,13 @@ export class Microservice
InternalService.start();
}
} catch(e) {
console.log("Failed to start the microservice");
console.error("Failed to start the microservice:", e);
return 1;
}
// Run the microservice
this.state = MicroserviceState.Running;
process.on("SIGINT", this.quit.bind(this));
let exitCode = await new Promise<number>((resolve) => this.__quitHandler = resolve);
// Shutdown the microservice


Loading…
Cancel
Save