ServicestatusQuery: Adjust `next_update` calculation to respect `next_check`

This commit is contained in:
Johannes Meyer 2019-09-26 15:11:05 +02:00
parent b9ea432d35
commit c21867699a
1 changed files with 4 additions and 4 deletions

View File

@ -213,17 +213,17 @@ class ServicestatusQuery extends IdoQuery
'service_next_notification' => 'UNIX_TIMESTAMP(ss.next_notification)', 'service_next_notification' => 'UNIX_TIMESTAMP(ss.next_notification)',
'service_next_update' => 'CASE WHEN ss.has_been_checked = 0 OR ss.has_been_checked IS NULL 'service_next_update' => 'CASE WHEN ss.has_been_checked = 0 OR ss.has_been_checked IS NULL
THEN THEN
NULL CASE ss.should_be_scheduled WHEN 1 THEN UNIX_TIMESTAMP(ss.next_check) + (ss.normal_check_interval * 60) ELSE NULL END
ELSE ELSE
UNIX_TIMESTAMP(ss.last_check) UNIX_TIMESTAMP(ss.next_check)
+ (CASE WHEN + (CASE WHEN
COALESCE(ss.current_state, 0) > 0 AND ss.state_type = 0 COALESCE(ss.current_state, 0) > 0 AND ss.state_type = 0
THEN THEN
ss.retry_check_interval ss.retry_check_interval
ELSE ELSE
ss.normal_check_interval ss.normal_check_interval
END * 60 END * 60)
+ CEIL(ss.execution_time) + CEIL(ss.latency)) * 2 + (CEIL(ss.execution_time + ss.latency) * 2)
END', END',
'service_no_more_notifications' => 'ss.no_more_notifications', 'service_no_more_notifications' => 'ss.no_more_notifications',
'service_normal_check_interval' => 'ss.normal_check_interval', 'service_normal_check_interval' => 'ss.normal_check_interval',