( by time.Duration, now time.Time, oldState, newState WorkspaceAgentMonitorState, )
| 869 | } |
| 870 | |
| 871 | func (m WorkspaceAgentMemoryResourceMonitor) Debounce( |
| 872 | by time.Duration, |
| 873 | now time.Time, |
| 874 | oldState, newState WorkspaceAgentMonitorState, |
| 875 | ) (time.Time, bool) { |
| 876 | if now.After(m.DebouncedUntil) && |
| 877 | oldState == WorkspaceAgentMonitorStateOK && |
| 878 | newState == WorkspaceAgentMonitorStateNOK { |
| 879 | return now.Add(by), true |
| 880 | } |
| 881 | |
| 882 | return m.DebouncedUntil, false |
| 883 | } |
| 884 | |
| 885 | func (m WorkspaceAgentVolumeResourceMonitor) Debounce( |
| 886 | by time.Duration, |
no test coverage detected