feat(cdc): add Re-sync sources button + auto-heal for Debezium connectors
- streaming_ops: add connector status discovery, manual resync endpoint (POST /api/pipeline/streaming/resync), connectors status endpoint, and a background connector_autoheal_loop that restarts FAILED tasks automatically - main: wire connector_autoheal_loop into app lifespan - api.ts: add resyncSources() helper - ChangesView: add "Re-sync sources" header button with live status
This commit is contained in:
@@ -115,6 +115,18 @@ export async function fetchChangeStats(minutes = 15): Promise<CdcStats | null> {
|
||||
return fetchJson<CdcStats>(`/api/changes/stats?minutes=${minutes}`, 8000)
|
||||
}
|
||||
|
||||
export type ConnectorState = { name: string; state?: string; failed?: number[] }
|
||||
export type ResyncResult = { ok: boolean; restarted?: string[]; healthy?: number; total?: number; after?: ConnectorState[] }
|
||||
|
||||
export async function resyncSources(force = true): Promise<ResyncResult | null> {
|
||||
const r = await fetch('/api/pipeline/streaming/resync', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ force }),
|
||||
})
|
||||
return r.ok ? ((await r.json()) as ResyncResult) : null
|
||||
}
|
||||
|
||||
export async function fetchAgentOpsStatus() {
|
||||
return fetchJson<Record<string, unknown>>('/api/agent-ops/status', 8000)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user