feat(relays): healthcheck

This commit is contained in:
x032205
2025-10-07 21:17:25 -04:00
parent c1833b5cbd
commit 12b59fc2c0
9 changed files with 191 additions and 6 deletions
@@ -0,0 +1,19 @@
import { Knex } from "knex";
import { TableName } from "../schemas";
export async function up(knex: Knex): Promise<void> {
if (!(await knex.schema.hasColumn(TableName.Relay, "heartbeat"))) {
await knex.schema.alterTable(TableName.Relay, (t) => {
t.datetime("heartbeat");
});
}
}
export async function down(knex: Knex): Promise<void> {
if (await knex.schema.hasColumn(TableName.Relay, "heartbeat")) {
await knex.schema.alterTable(TableName.Relay, (t) => {
t.dropColumn("heartbeat");
});
}
}
+2 -1
View File
@@ -14,7 +14,8 @@ export const RelaysSchema = z.object({
orgId: z.string().uuid().nullable().optional(),
identityId: z.string().uuid().nullable().optional(),
name: z.string(),
host: z.string()
host: z.string(),
heartbeat: z.date().nullable().optional()
});
export type TRelays = z.infer<typeof RelaysSchema>;