MCPcopy
hub / github.com/wavetermdev/waveterm / jobPruningWorker

Function jobPruningWorker

pkg/jobcontroller/jobcontroller.go:303–315  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

301}
302
303func jobPruningWorker() {
304 defer func() {
305 panichandler.PanicHandler("jobcontroller:jobPruningWorker", recover())
306 }()
307
308 ticker := time.NewTicker(1 * time.Minute)
309 defer ticker.Stop()
310
311 var previousCandidates []string
312 for range ticker.C {
313 previousCandidates = pruneUnusedJobs(previousCandidates)
314 }
315}
316
317func pruneUnusedJobs(previousCandidates []string) []string {
318 ctx, cancelFn := context.WithTimeout(context.Background(), 30*time.Second)

Callers 1

InitJobControllerFunction · 0.85

Calls 3

PanicHandlerFunction · 0.92
pruneUnusedJobsFunction · 0.85
StopMethod · 0.65

Tested by

no test coverage detected