mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 21:19:13 +00:00
Add readyness check
This commit is contained in:
parent
51b70505c5
commit
7da5d6906a
@ -43,9 +43,10 @@ export class GithubBridge {
|
|||||||
private tokenStore!: UserTokenStore;
|
private tokenStore!: UserTokenStore;
|
||||||
private messageClient!: MessageSenderClient;
|
private messageClient!: MessageSenderClient;
|
||||||
private widgetApi!: BridgeWidgetApi;
|
private widgetApi!: BridgeWidgetApi;
|
||||||
|
|
||||||
private connections: IConnection[] = [];
|
private connections: IConnection[] = [];
|
||||||
|
|
||||||
|
private ready = false;
|
||||||
|
|
||||||
constructor(private config: BridgeConfig, private registration: IAppserviceRegistration) { }
|
constructor(private config: BridgeConfig, private registration: IAppserviceRegistration) { }
|
||||||
|
|
||||||
private async createConnectionForState(roomId: string, state: StateEvent<any>) {
|
private async createConnectionForState(roomId: string, state: StateEvent<any>) {
|
||||||
@ -244,6 +245,10 @@ export class GithubBridge {
|
|||||||
registration: this.registration,
|
registration: this.registration,
|
||||||
storage,
|
storage,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.as.expressAppInstance.get("/health", (_, res) => res.send({ok: true}));
|
||||||
|
this.as.expressAppInstance.get("/ready", (_, res) => res.status(this.ready ? 200 : 500).send({ready: this.ready}));
|
||||||
|
|
||||||
if (this.config.bridge.pantalaimon) {
|
if (this.config.bridge.pantalaimon) {
|
||||||
log.info(`Loading pantalaimon client`);
|
log.info(`Loading pantalaimon client`);
|
||||||
const pan = new PantalaimonClient(
|
const pan = new PantalaimonClient(
|
||||||
@ -660,6 +665,7 @@ export class GithubBridge {
|
|||||||
}
|
}
|
||||||
await this.as.begin();
|
await this.as.begin();
|
||||||
log.info("Started bridge");
|
log.info("Started bridge");
|
||||||
|
this.ready = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async onRoomInvite(roomId: string, event: MatrixEvent<MatrixMemberContent>) {
|
private async onRoomInvite(roomId: string, event: MatrixEvent<MatrixMemberContent>) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user