( request: FastifyRequestTypebox<typeof HealthCheckSchema>, reply: FastifyReplyTypebox<typeof HealthCheckSchema>, )
| 18 | * @returns {Promise<import('../models/ModelHealthCheck')[]>} - The health check data from the database |
| 19 | */ |
| 20 | export const triggerHealthCheck = async ( |
| 21 | request: FastifyRequestTypebox<typeof HealthCheckSchema>, |
| 22 | reply: FastifyReplyTypebox<typeof HealthCheckSchema>, |
| 23 | ) => { |
| 24 | try { |
| 25 | const promises = [ |
| 26 | checkOpenaiHealth(request.server.orm), |
| 27 | checkChatOpenaiHealth(request.server.orm), |
| 28 | checkAnthropicHealth(request.server.orm), |
| 29 | checkCohereHealth(request.server.orm), |
| 30 | ]; |
| 31 | await Promise.all(promises); |
| 32 | return await request.server.orm.getRepository(ModelHealthCheck).find(); |
| 33 | } catch (e: any) { |
| 34 | Sentry.captureException(e); |
| 35 | reply.code(500).send(e); |
| 36 | } |
| 37 | }; |
| 38 | |
| 39 | /** |
| 40 | * Get health check data within a specific date range |
nothing calls this directly
no test coverage detected