MCPcopy
hub / github.com/puma/puma-dev / idleMonitor

Method idleMonitor

dev/app.go:158–173  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

156}
157
158func (a *App) idleMonitor() error {
159 ticker := time.NewTicker(10 * time.Second)
160 defer ticker.Stop()
161
162 for {
163 select {
164 case <-ticker.C:
165 if a.pool.maybeIdle(a) {
166 a.Kill("app is idle")
167 return nil
168 }
169 case <-a.t.Dying():
170 return nil
171 }
172 }
173}
174
175func (a *App) restartMonitor() error {
176 tmpDir := filepath.Join(a.dir, "tmp")

Callers

nothing calls this directly

Calls 2

KillMethod · 0.95
maybeIdleMethod · 0.80

Tested by

no test coverage detected