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

Function GetNumJobsRunning

pkg/jobcontroller/jobcontroller.go:553–567  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

551}
552
553func GetNumJobsRunning() int {
554 ctx, cancelFn := context.WithTimeout(context.Background(), 2*time.Second)
555 defer cancelFn()
556 allJobs, err := wstore.DBGetAllObjsByType[*waveobj.Job](ctx, waveobj.OType_Job)
557 if err != nil {
558 return 0
559 }
560 count := 0
561 for _, job := range allJobs {
562 if job.JobManagerStatus == JobManagerStatus_Running {
563 count++
564 }
565 }
566 return count
567}
568
569func GetNumJobsConnected() int {
570 jobControllerLock.Lock()

Callers 1

updateTelemetryCountsFunction · 0.92

Calls 1

DBGetAllObjsByTypeFunction · 0.92

Tested by

no test coverage detected