diff options
-rw-r--r-- | src/build.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/build.cc b/src/build.cc index 081c156..98952e0 100644 --- a/src/build.cc +++ b/src/build.cc @@ -84,7 +84,9 @@ int build(const Settings& settings, return task->run(); })); started_one = true; - std::this_thread::sleep_for(2ms); + // Make sure we don't start tasks on top of each other to prevent + // straining the disk. + std::this_thread::sleep_for(50ms); } for(auto process = processes.begin(); @@ -106,13 +108,9 @@ int build(const Settings& settings, break; } - if(started_one) + if(!started_one) // prevent polling too fast if no task is yet ready { - std::this_thread::sleep_for(2ms); - } - else - { - std::this_thread::sleep_for(200ms); + std::this_thread::sleep_for(10ms); } } |