diff options
author | Emmanuel Vasilakis <mrzammler@mm.st> | 2022-11-10 18:37:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-10 18:37:10 +0200 |
commit | 4afc63c85d319c8965ab446af6d167f5e9eb3199 (patch) | |
tree | d5e063e50fc092baf093eb1b7aff1d9c8d45cee5 /ml/Host.cc | |
parent | d62a168074b6771e0bb5de7a1c1ab2901a912be5 (diff) |
Remove health_thread_stop (#13948)
* remove health_thread_stop
* soft sleeps
Diffstat (limited to 'ml/Host.cc')
-rw-r--r-- | ml/Host.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ml/Host.cc b/ml/Host.cc index 0261061454..4a57178c76 100644 --- a/ml/Host.cc +++ b/ml/Host.cc @@ -141,7 +141,12 @@ void TrainableHost::train() { worker_is_idle(); SleepFor = std::min(AllottedDuration - RealDuration, MaxSleepFor); - std::this_thread::sleep_for(SleepFor); + TimePoint Now = SteadyClock::now(); + auto Until = Now + SleepFor; + while (Now < Until && !netdata_exit) { + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + Now = SteadyClock::now(); + } worker_is_busy(0); } } |