mirror of https://github.com/Icinga/icinga2.git
parent
dadc21e12a
commit
f9e0fd2e3e
|
@ -97,18 +97,25 @@ bool ApiListener::UpdateConfigDir(const ConfigDirInformation& oldConfigInfo, con
|
||||||
else
|
else
|
||||||
newTimestamp = newConfig->Get("/.timestamp");
|
newTimestamp = newConfig->Get("/.timestamp");
|
||||||
|
|
||||||
/* skip update if our config is newer */
|
/* skip update if our configuration files are more recent */
|
||||||
if (oldTimestamp >= newTimestamp) {
|
if (oldTimestamp >= newTimestamp) {
|
||||||
/* TODO: Less ugly */
|
|
||||||
Log(LogInformation, "ApiListener")
|
Log(LogInformation, "ApiListener")
|
||||||
<< "Old timestamp '" << std::setprecision(std::numeric_limits<double>::digits10 + 1)
|
<< "Cannot apply configuration file update for path '" << configDir << "'. Current timestamp '"
|
||||||
<< oldTimestamp << "' is more recent than new one '" << newTimestamp << "'.";
|
<< Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", oldTimestamp) << "' ("
|
||||||
|
<< std::fixed << std::setprecision(6) << oldTimestamp
|
||||||
|
<< ") is more recent than received timestamp '"
|
||||||
|
<< Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", newTimestamp) << "' ("
|
||||||
|
<< newTimestamp << ").";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log(LogInformation, "ApiListener")
|
Log(LogInformation, "ApiListener")
|
||||||
<< "New timestamp '" << std::setprecision (std::numeric_limits<double>::digits10 + 1) << newTimestamp
|
<< "Applying configuration file update for path '" << configDir << "'. Received timestamp '"
|
||||||
<< "' is more recent than old one '" << oldTimestamp << "'.";
|
<< Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", newTimestamp) << "' ("
|
||||||
|
<< std::fixed << std::setprecision(6) << newTimestamp
|
||||||
|
<< ") is more recent than current timestamp '"
|
||||||
|
<< Utility::FormatDateTime("%Y-%m-%d %H:%M:%S %z", oldTimestamp) << "' ("
|
||||||
|
<< oldTimestamp << ").";
|
||||||
|
|
||||||
{
|
{
|
||||||
ObjectLock olock(newConfig);
|
ObjectLock olock(newConfig);
|
||||||
|
|
Loading…
Reference in New Issue