mirror of https://github.com/Icinga/icinga2.git
parent
a4562fb433
commit
d412a9055d
|
@ -58,14 +58,22 @@ bool ApiListener::UpdateConfigDir(const Dictionary::Ptr& oldConfig, const Dictio
|
||||||
{
|
{
|
||||||
bool configChange = false;
|
bool configChange = false;
|
||||||
|
|
||||||
if (!(oldConfig->Contains(".timestamp") && newConfig->Contains(".timestamp")))
|
double oldTimestamp;
|
||||||
return false;
|
|
||||||
|
|
||||||
double oldTimestamp = Convert::ToDouble(oldConfig->Get(".timestamp"));
|
if (!oldConfig->Contains(".timestamp"))
|
||||||
double newTimestamp = Convert::ToDouble(newConfig->Get(".timestamp"));
|
oldTimestamp = 0;
|
||||||
|
else
|
||||||
|
oldTimestamp = oldConfig->Get(".timestamp");
|
||||||
|
|
||||||
|
double newTimestamp;
|
||||||
|
|
||||||
|
if (!newConfig->Contains(".timestamp"))
|
||||||
|
newTimestamp = Utility::GetTime();
|
||||||
|
else
|
||||||
|
newTimestamp = newConfig->Get(".timestamp");
|
||||||
|
|
||||||
/* skip update if our config is newer */
|
/* skip update if our config is newer */
|
||||||
if (oldTimestamp <= newTimestamp)
|
if (oldTimestamp >= newTimestamp)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue