From 156b8f9c39a81cbbad7c32dbebdf321787611779 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 22 Mar 2017 16:40:15 +0000 Subject: Send diag request only if not other one with some id running Fix: elapsed function return that do not compute elapsed_time at first time Fix: reworked should_send() to get it work with our scheduling workflow Reschedule trying to send request if recurring even it is in flight. Change-Id: Idce54cb9bf62616c891a8a25a6c478f931350bc7 Signed-off-by: Romain Forlot --- src/diagnostic/active-diagnostic-request.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/diagnostic/active-diagnostic-request.cpp') diff --git a/src/diagnostic/active-diagnostic-request.cpp b/src/diagnostic/active-diagnostic-request.cpp index a9c21c63..ad6e59e4 100644 --- a/src/diagnostic/active-diagnostic-request.cpp +++ b/src/diagnostic/active-diagnostic-request.cpp @@ -155,14 +155,13 @@ bool active_diagnostic_request_t::is_diagnostic_signal(const std::string& name) /// @brief Check is the request should be sent or not /// -/// @return true if the request isn't already running and not -/// recurring nor completed, or it is recurring its clock elapsed so it's -/// time to send another one. +/// @return true if the request is not running or recurring nor completed, +/// or it's recurring, its clock elapsed, request was successful +/// so it's time to send another one. bool active_diagnostic_request_t::should_send() { - return !get_in_flight() && ( - (!get_recurring() && !request_completed()) || - (get_recurring() && get_frequency_clock().elapsed(true))); + return !in_flight_ || (!recurring_ && !request_completed()) || + (recurring_ && frequency_clock_.elapsed(true) && request_completed() && handle_->success); } /// @brief check if the timeout clock has elapsed -- cgit 1.2.3-korg