File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99namespace OCA \Libresign \Service \Worker ;
1010
11+ use OCA \Libresign \Service \Process \ProcessManager ;
1112use Psr \Log \LoggerInterface ;
1213
1314class WorkerHealthService {
15+ private const PROCESS_SOURCE = 'worker ' ;
16+
1417 public function __construct (
1518 private WorkerConfiguration $ workerConfiguration ,
16- private WorkerCounter $ workerCounter ,
19+ private ProcessManager $ processManager ,
1720 private WorkerJobCounter $ workerJobCounter ,
1821 private StartThrottlePolicy $ startThrottlePolicy ,
1922 private WorkerStarter $ workerStarter ,
@@ -54,7 +57,7 @@ public function ensureWorkerRunning(): bool {
5457
5558 private function calculateWorkersNeeded (): int {
5659 $ desired = $ this ->workerConfiguration ->getDesiredWorkerCount ();
57- $ running = $ this ->workerCounter ->countRunning ();
60+ $ running = $ this ->processManager ->countRunning (self :: PROCESS_SOURCE );
5861 $ pendingJobs = $ this ->workerJobCounter ->countPendingJobs ();
5962
6063 if ($ this ->hasNoPendingWork ($ pendingJobs )) {
You can’t perform that action at this time.
0 commit comments