MCPcopy Create free account
hub / github.com/PostHog/duckgres / doHealthCheckWithMetadataImpl

Function doHealthCheckWithMetadataImpl

controlplane/worker_mgr.go:606–627  ·  view source on GitHub ↗
(ctx context.Context, client *flightsql.Client, payload server.WorkerHealthCheckPayload)

Source from the content-addressed store, hash-verified

604func (r *healthCheckResult) toSessionProgress() map[string]*SessionProgress {
605 if len(r.SessionProgress) == 0 {
606 return nil
607 }
608 out := make(map[string]*SessionProgress, len(r.SessionProgress))
609 for token, sp := range r.SessionProgress {
610 out[token] = &SessionProgress{
611 Percentage: sp.Pct,
612 Rows: sp.Rows,
613 TotalRows: sp.Total,
614 Stalled: sp.Stalled,
615 }
616 }
617 return out
618}
619
620// doHealthCheck performs a HealthCheck action on the worker.
621// The server sends exactly one Result message with {"healthy": true, ...}.
622// Returns the parsed result (including per-session progress) and an error if
623// the worker is unreachable.
624func doHealthCheck(ctx context.Context, client *flightsql.Client) (*healthCheckResult, error) {
625 return doHealthCheckWithMetadata(ctx, client, server.WorkerHealthCheckPayload{})
626}
627
628var doHealthCheckWithMetadata = doHealthCheckWithMetadataImpl
629
630func doHealthCheckWithMetadataImpl(ctx context.Context, client *flightsql.Client, payload server.WorkerHealthCheckPayload) (*healthCheckResult, error) {

Callers

nothing calls this directly

Calls 2

DoActionMethod · 0.45
RecvMethod · 0.45

Tested by

no test coverage detected