| 15 | } |
| 16 | |
| 17 | type ControlPlaneRuntimeTracker struct { |
| 18 | store runtimeInstanceStore |
| 19 | id string |
| 20 | podName string |
| 21 | heartbeatInterval time.Duration |
| 22 | now func() time.Time |
| 23 | |
| 24 | draining atomic.Bool |
| 25 | |
| 26 | mu sync.Mutex |
| 27 | started bool |
| 28 | startedAt time.Time |
| 29 | drainingAt *time.Time |
| 30 | } |
| 31 | |
| 32 | func NewControlPlaneRuntimeTracker(store runtimeInstanceStore, id, podName string, heartbeatInterval time.Duration) *ControlPlaneRuntimeTracker { |
| 33 | if heartbeatInterval <= 0 { |
nothing calls this directly
no outgoing calls
no test coverage detected