|
@ -105,12 +105,17 @@ export class Microservice |
|
|
this.state = MicroserviceState.Booting; |
|
|
this.state = MicroserviceState.Booting; |
|
|
await this.boot(); |
|
|
await this.boot(); |
|
|
|
|
|
|
|
|
|
|
|
// Linking the internal services
|
|
|
|
|
|
for (let service of Object.values(this.service)) { |
|
|
|
|
|
service.link(this); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Start the microservice
|
|
|
// Start the microservice
|
|
|
console.log("Starting services..."); |
|
|
console.log("Starting services..."); |
|
|
this.state = MicroserviceState.Starting |
|
|
this.state = MicroserviceState.Starting |
|
|
await this.onStart(); |
|
|
await this.onStart(); |
|
|
for (let InternalService of Object.values(this.services)) { |
|
|
|
|
|
InternalService.start(); |
|
|
|
|
|
|
|
|
for (let service of Object.values(this.services)) { |
|
|
|
|
|
service.start(); |
|
|
} |
|
|
} |
|
|
} catch(e) { |
|
|
} catch(e) { |
|
|
console.error("Failed to start the microservice:", e); |
|
|
console.error("Failed to start the microservice:", e); |
|
|