mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Fix local timestamp for PostgreSQL queries
This fixes the "monitoring health" view indicating that Icinga 2 isn't updating the database, even if status_update_time uptodate. refs #2651 Signed-off-by: Eric Lippmann <eric.lippmann@icinga.com>
This commit is contained in:
parent
326574ba54
commit
b474482188
@ -656,7 +656,7 @@ abstract class IdoQuery extends DbQuery
|
|||||||
$column
|
$column
|
||||||
);
|
);
|
||||||
if (version_compare($this->getIdoVersion(), '1.14.2', '>=')) {
|
if (version_compare($this->getIdoVersion(), '1.14.2', '>=')) {
|
||||||
$column = str_replace('NOW()', 'localtimestamp', $column);
|
$column = str_replace('NOW()', 'NOW() AT TIME ZONE \'UTC\'', $column);
|
||||||
} else {
|
} else {
|
||||||
$column = preg_replace(
|
$column = preg_replace(
|
||||||
'/UNIX_TIMESTAMP(\((?>[^()]|(?-1))*\))/i',
|
'/UNIX_TIMESTAMP(\((?>[^()]|(?-1))*\))/i',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user