Fix cluster config timestamp again

refs #11014
This commit is contained in:
Michael Friedrich 2016-01-25 15:21:25 +01:00
parent a4562fb433
commit d412a9055d
1 changed files with 13 additions and 5 deletions

View File

@ -58,14 +58,22 @@ bool ApiListener::UpdateConfigDir(const Dictionary::Ptr& oldConfig, const Dictio
{
bool configChange = false;
if (!(oldConfig->Contains(".timestamp") && newConfig->Contains(".timestamp")))
return false;
double oldTimestamp;
double oldTimestamp = Convert::ToDouble(oldConfig->Get(".timestamp"));
double newTimestamp = Convert::ToDouble(newConfig->Get(".timestamp"));
if (!oldConfig->Contains(".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 */
if (oldTimestamp <= newTimestamp)
if (oldTimestamp >= newTimestamp)
return false;
{