fix(telemetry): start scheduler from admin dashboard too, not only health probes
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
|||||||
transformClientError,
|
transformClientError,
|
||||||
transformClientEvent,
|
transformClientEvent,
|
||||||
} from "@/lib/pocketbase/util/transform-types";
|
} from "@/lib/pocketbase/util/transform-types";
|
||||||
import { getSchedulerStatus } from "@/lib/telemetry/scheduler.server";
|
import { ensureTelemetryScheduler, getSchedulerStatus } from "@/lib/telemetry/scheduler.server";
|
||||||
import { getHealthSnapshot } from "@/lib/telemetry/health.server";
|
import { getHealthSnapshot } from "@/lib/telemetry/health.server";
|
||||||
import { getActiveConnectionCount } from "@/lib/events/emitter";
|
import { getActiveConnectionCount } from "@/lib/events/emitter";
|
||||||
import type {
|
import type {
|
||||||
@@ -161,6 +161,9 @@ export const getTelemetryRuntimeStatus = createServerFn()
|
|||||||
.middleware([superTokensAdminFunctionMiddleware])
|
.middleware([superTokensAdminFunctionMiddleware])
|
||||||
.handler(async () =>
|
.handler(async () =>
|
||||||
toServerResult<TelemetryRuntimeStatus>(async () => {
|
toServerResult<TelemetryRuntimeStatus>(async () => {
|
||||||
|
// Dev has no k8s probes hitting /api/health, so opening the dashboard
|
||||||
|
// is the scheduler's fallback starter.
|
||||||
|
ensureTelemetryScheduler();
|
||||||
const health = await getHealthSnapshot();
|
const health = await getHealthSnapshot();
|
||||||
return {
|
return {
|
||||||
health: { status: health.status, checks: health.checks },
|
health: { status: health.status, checks: health.checks },
|
||||||
|
|||||||
Reference in New Issue
Block a user