diff options
| author | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-06-16 20:00:53 +0200 | 
|---|---|---|
| committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2022-06-16 20:00:53 +0200 | 
| commit | 5ed9b42bad3d1fed22f371da6672ffaf044c57aa (patch) | |
| tree | 65abd5a5024b2e4975f4925fe9c13a3b7156f34e | |
| parent | b1b290b0e3cad1b362ec56a7aeb8db05e63007da (diff) | |
Tweak sleeps in builder loop.
| -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);  		}  	} | 
