From e327633a36cd60007ed504530a26baeea17ae9d0 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Fri, 2 Jun 2017 18:49:13 +0100 Subject: [PATCH] Correct calculation of restart timeout, and up timeout to 200ms. --- src/service.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/service.cc b/src/service.cc index 08145e2..69e8cbc 100644 --- a/src/service.cc +++ b/src/service.cc @@ -1191,14 +1191,14 @@ void base_process_service::restart_ps_process() noexcept tdiff_ns = 1000000000 - (last_start_time.tv_nsec - current_time.tv_nsec); } - if (tdiff_s > 0 || tdiff_ns > 100000000) { - // > 100ms + if (tdiff_s > 0 || tdiff_ns > 200000000) { + // > 200ms start_ps_process(); } else { timespec timeout; - timeout.tv_sec = tdiff_s; - timeout.tv_nsec = tdiff_ns; + timeout.tv_sec = 0; + timeout.tv_nsec = 200000000 - tdiff_ns; restart_timer.arm_timer_rel(eventLoop, timeout); } } -- 2.25.1