@@ -206,14 +206,14 @@ impl ProofWorkerHandle {
206206 }
207207 }
208208
209- /// Returns true if there are available storage workers to process tasks .
210- pub fn has_available_storage_workers ( & self ) -> bool {
211- self . storage_available_workers . load ( Ordering :: Relaxed ) > 0
209+ /// Returns how many storage workers are currently available/idle .
210+ pub fn available_storage_workers ( & self ) -> usize {
211+ self . storage_available_workers . load ( Ordering :: Relaxed )
212212 }
213213
214- /// Returns true if there are available account workers to process tasks .
215- pub fn has_available_account_workers ( & self ) -> bool {
216- self . account_available_workers . load ( Ordering :: Relaxed ) > 0
214+ /// Returns how many account workers are currently available/idle .
215+ pub fn available_account_workers ( & self ) -> usize {
216+ self . account_available_workers . load ( Ordering :: Relaxed )
217217 }
218218
219219 /// Returns the number of pending storage tasks in the queue.
@@ -240,16 +240,14 @@ impl ProofWorkerHandle {
240240 ///
241241 /// This is calculated as total workers minus available workers.
242242 pub fn active_storage_workers ( & self ) -> usize {
243- self . storage_worker_count
244- . saturating_sub ( self . storage_available_workers . load ( Ordering :: Relaxed ) )
243+ self . storage_worker_count . saturating_sub ( self . available_storage_workers ( ) )
245244 }
246245
247246 /// Returns the number of account workers currently processing tasks.
248247 ///
249248 /// This is calculated as total workers minus available workers.
250249 pub fn active_account_workers ( & self ) -> usize {
251- self . account_worker_count
252- . saturating_sub ( self . account_available_workers . load ( Ordering :: Relaxed ) )
250+ self . account_worker_count . saturating_sub ( self . available_account_workers ( ) )
253251 }
254252
255253 /// Dispatch a storage proof computation to storage worker pool
0 commit comments