mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
Code style
This commit is contained in:
parent
0634e27d6d
commit
1d21626b30
@ -75,7 +75,7 @@ void RedisConnection::HandleRW()
|
||||
|
||||
void RedisConnection::RedisInitialCallback(redisAsyncContext *c, void *r, void *p)
|
||||
{
|
||||
auto *state = (ConnectionState *) p;
|
||||
auto state = (ConnectionState *) p;
|
||||
if (state->state != Starting && !r) {
|
||||
Log(LogCritical, "RedisConnection")
|
||||
<< "No answer from Redis during initial connection, is the Redis server running?";
|
||||
|
@ -81,9 +81,9 @@ void RedisWriter::UpdateAllConfigObjects()
|
||||
|
||||
upq.ParallelFor(types, [this](const TypePair& type) {
|
||||
size_t bulkCounter = 0;
|
||||
std::vector<String> attributes = std::vector<String>({"HMSET", m_PrefixConfigObject + type.second});
|
||||
std::vector<String> customVars = std::vector<String>({"HMSET", m_PrefixConfigCustomVar + type.second});
|
||||
std::vector<String> checksums = std::vector<String>({"HMSET", m_PrefixConfigCheckSum + type.second});
|
||||
auto attributes = std::vector<String>({"HMSET", m_PrefixConfigObject + type.second});
|
||||
auto customVars = std::vector<String>({"HMSET", m_PrefixConfigCustomVar + type.second});
|
||||
auto checksums = std::vector<String>({"HMSET", m_PrefixConfigCheckSum + type.second});
|
||||
|
||||
for (const ConfigObject::Ptr& object : type.first->GetObjects()) {
|
||||
CreateConfigUpdate(object, attributes, customVars, checksums, false);
|
||||
@ -138,9 +138,9 @@ static ConfigObject::Ptr GetObjectByName(const String& name)
|
||||
void RedisWriter::SendConfigUpdate(const ConfigObject::Ptr& object, bool runtimeUpdate)
|
||||
{
|
||||
String typeName = object->GetReflectionType()->GetName().ToLower();
|
||||
std::vector<String> attributes = std::vector<String>({"HMSET", m_PrefixConfigObject + typeName});
|
||||
std::vector<String> customVars = std::vector<String>({"HMSET", m_PrefixConfigCustomVar + typeName});
|
||||
std::vector<String> checksums = std::vector<String>({"HMSET", m_PrefixConfigCheckSum + typeName});
|
||||
auto attributes = std::vector<String>({"HMSET", m_PrefixConfigObject + typeName});
|
||||
auto customVars = std::vector<String>({"HMSET", m_PrefixConfigCustomVar + typeName});
|
||||
auto checksums = std::vector<String>({"HMSET", m_PrefixConfigCheckSum + typeName});
|
||||
|
||||
CreateConfigUpdate(object, attributes, customVars, checksums, runtimeUpdate);
|
||||
|
||||
|
@ -138,11 +138,14 @@ void RedisWriter::UpdateSubscriptions()
|
||||
|
||||
Log(LogInformation, "RedisWriter", "Updating Redis subscriptions");
|
||||
|
||||
if (!m_Rcon->IsConnected()) {
|
||||
Log(LogCritical, "DEBUG, Redis")
|
||||
<< "NO CONNECT CHIEF";
|
||||
/* TODO:
|
||||
* Silently return in this case. Usually the RedisConnection checks for connectivity and logs in failure case.
|
||||
* But since we expect and answer here and break Icinga in case of receiving no answer/an unexpected one we opt for
|
||||
* better safe than sorry here. Future implementation needs to include an improved error handling and answer verification.
|
||||
*/
|
||||
if (!m_Rcon->IsConnected())
|
||||
return;
|
||||
}
|
||||
|
||||
long long cursor = 0;
|
||||
|
||||
String keyPrefix = "icinga:subscription:";
|
||||
|
Loading…
x
Reference in New Issue
Block a user