MCPcopy Create free account
hub / github.com/devspace-sh/devspace / Start

Method Start

pkg/util/idle/idle.go:40–57  ·  view source on GitHub ↗
(timeout time.Duration, log log.Logger)

Source from the content-addressed store, hash-verified

38}
39
40func (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
59type unsupportedError struct{}
60

Callers

nothing calls this directly

Calls 3

StopDevSpaceFunction · 0.92
IdleMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected