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)
| 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). |
| 977 | func (sm *SessionManager) WorkerTTLForPID(pid int32) (time.Duration, bool) { |
nothing calls this directly
no outgoing calls
no test coverage detected