RedisWriter: Explicitly checksum Zone#endpoints

This commit is contained in:
Alexander A. Klimov 2018-06-06 12:31:41 +02:00 committed by Michael Friedrich
parent dcdf6b8a44
commit e980485e23
1 changed files with 17 additions and 0 deletions

View File

@ -172,6 +172,23 @@ void RedisWriter::SendConfigUpdate(const ConfigObject::Ptr& object, bool useTran
checkSums->Set("groups_checksum", CalculateCheckSumGroups(service->GetGroups()));
else
checkSums->Set("groups_checksum", CalculateCheckSumGroups(host->GetGroups()));
} else {
Zone::Ptr zone = dynamic_pointer_cast<Zone>(object);
if (zone) {
propertiesBlacklist.emplace("endpoints");
auto endpointObjects = zone->GetEndpoints();
Array::Ptr endpoints = new Array();
endpoints->Resize(endpointObjects.size());
Array::SizeType i = 0;
for (auto& endpointObject : endpointObjects) {
endpoints->Set(i++, endpointObject->GetName());
}
checkSums->Set("endpoints_checksum", CalculateCheckSumGroups(endpoints));
}
}
//TODO: Move this somewhere else.