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

Method ProtocolForPID

controlplane/session_mgr.go:967–974  ·  view source on GitHub ↗

ProtocolForPID returns the wire protocol ("postgres"/"flight") for a session, or "" if not found. O(1) lookup for the admin live-query detail view.

(pid int32)

Source from the content-addressed store, hash-verified

965 }
966 if !pool.SetWorkerTTL(s.WorkerID, ttl) {
967 return fmt.Errorf("worker %d is no longer in the pool", s.WorkerID)
968 }
969 return nil
970}
971
972// WorkerTTLForPID reports the hot-idle TTL the worker bound to pid's session
973// would park with right now — the SHOW half of the `duckgres.worker_ttl`
974// session GUC. ok=false when there is no session, no worker, or the pool has
975// no per-worker TTL. A zero TTL with ok=true means the deployment default
976// applies at reap time (the caller resolves it).
977func (sm *SessionManager) WorkerTTLForPID(pid int32) (time.Duration, bool) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected