(timeout time.Duration, log log.Logger)
| 38 | } |
| 39 | |
| 40 | func (m *monitor) Start(timeout time.Duration, log log.Logger) { |
| 41 | if timeout <= 0 { |
| 42 | return |
| 43 | } |
| 44 | |
| 45 | go func() { |
| 46 | wait.Forever(func() { |
| 47 | duration, err := m.Getter.Idle() |
| 48 | if err != nil { |
| 49 | // don't do anything |
| 50 | return |
| 51 | } else if duration > timeout { |
| 52 | // we exit here |
| 53 | kill.StopDevSpace(fmt.Sprintf("Automatically exit DevSpace, because the user is inactive for %s. To disable automatic exiting, run with --inactivity-timeout=0", duration.String())) |
| 54 | } |
| 55 | }, time.Second*10) |
| 56 | }() |
| 57 | } |
| 58 | |
| 59 | type unsupportedError struct{} |
| 60 |
nothing calls this directly
no test coverage detected