MCPcopy Create free account
hub / github.com/Writesonic/GPTRouter / updateHealthCheck

Function updateHealthCheck

src/utils/updateHealthCheck.ts:19–32  ·  view source on GitHub ↗
(params: HealthCheckParams, orm: DataSource)

Source from the content-addressed store, hash-verified

17 * @returns {Promise<void>} - A promise that resolves when the health check is updated
18 */
19export default async function updateHealthCheck(params: HealthCheckParams, orm: DataSource) {
20 const { modelId, providerId, isAvailable, status, latency } = params;
21 const updateData = { isAvailable, status, latency };
22
23 // TODO: @typescript-eslint/no-unused-vars
24 // const healthCheckObj = await orm
25 // .getRepository(ModelHealthCheck)
26 // .findOne({ where: { modelId: modelId, providerId: providerId } });
27
28 await orm
29 .getRepository(ModelHealthCheck)
30 .create({ modelId, providerId, ...updateData })
31 .save();
32}

Callers 4

checkAnthropicHealthFunction · 0.85
checkOpenaiHealthFunction · 0.85
checkOpenaiHealthFunction · 0.85
checkCohereHealthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected