this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add health check endpoint

futurGH 43297f38 c7460efe

+14
+14
src/LabelerServer.ts
··· 133 133 { websocket: true }, 134 134 this.subscribeLabelsHandler, 135 135 ); 136 + this.app.get("/xrpc/_health", this.healthHandler); 136 137 this.app.get("/xrpc/*", this.unknownMethodHandler); 137 138 this.app.setErrorHandler(this.errorHandler); 138 139 }); ··· 560 561 createdAt: new Date().toISOString(), 561 562 } satisfies ToolsOzoneModerationEmitEvent.Output, 562 563 ); 564 + }; 565 + 566 + /** 567 + * Handler for the health check endpoint. 568 + */ 569 + healthHandler: QueryHandler = async (_req, res) => { 570 + const VERSION = "0.1.13"; 571 + try { 572 + await this.db.execute({ sql: "SELECT 1", args: [] }); 573 + return res.send({ version: VERSION }); 574 + } catch (e) { 575 + return res.status(503).send({ version: VERSION, error: "Service Unavailable" }); 576 + } 563 577 }; 564 578 565 579 /**