@@ -12,7 +12,6 @@ use std::sync::{
12
12
Mutex ,
13
13
} ;
14
14
use std:: time:: Duration ;
15
- use systemstat:: { Platform , System } ;
16
15
17
16
pub ( super ) struct Worker < ' a , DB : WriteResults + Sync > {
18
17
name : String ,
@@ -56,32 +55,16 @@ impl<'a, DB: WriteResults + Sync> Worker<'a, DB> {
56
55
& self . name
57
56
}
58
57
59
- pub ( super ) fn run ( & self , threads_count : usize ) -> Fallible < ( ) > {
58
+ pub ( super ) fn run ( & self ) -> Fallible < ( ) > {
60
59
// This uses a `loop` instead of a `while let` to avoid locking the graph too much
61
60
let mut guard = self . graph . lock ( ) . unwrap ( ) ;
62
- let system = System :: new ( ) ;
63
61
loop {
64
62
self . maybe_cleanup_target_dir ( ) ?;
65
63
let walk_result = guard. next_task ( self . ex , self . db , & self . name ) ;
66
64
match walk_result {
67
65
WalkResult :: Task ( id, task) => {
68
66
drop ( guard) ;
69
67
info ! ( "running task: {:?}" , task) ;
70
-
71
- // Wait for 15 seconds before running if the 1 minute load
72
- // average exceeds the thread count. This tries to back off
73
- // from spawning too many jobs on the server, hopefully
74
- // improving performance.
75
- loop {
76
- let avg = system. load_average ( ) ?;
77
-
78
- if avg. one > threads_count as f32 {
79
- std:: thread:: sleep ( std:: time:: Duration :: new ( 15 , 0 ) ) ;
80
- } else {
81
- break ;
82
- }
83
- }
84
-
85
68
let res = task. run (
86
69
self . config ,
87
70
self . workspace ,
0 commit comments