mirror of https://github.com/Icinga/icinga2.git
parent
1bbdd082b0
commit
6b48a36192
|
@ -112,6 +112,25 @@ void RedisWriter::TryToReconnect(void)
|
||||||
freeReplyObject(reply);
|
freeReplyObject(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int dbIndex = GetDbIndex();
|
||||||
|
|
||||||
|
if (dbIndex != 0) {
|
||||||
|
redisReply *reply = reinterpret_cast<redisReply *>(redisCommand(m_Context, "SELECT %d", dbIndex));
|
||||||
|
|
||||||
|
if (!reply) {
|
||||||
|
redisFree(m_Context);
|
||||||
|
m_Context = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (reply->type == REDIS_REPLY_STATUS || reply->type == REDIS_REPLY_ERROR) {
|
||||||
|
Log(LogInformation, "RedisWriter")
|
||||||
|
<< "SELECT " << dbIndex << ": " << reply->str;
|
||||||
|
}
|
||||||
|
|
||||||
|
freeReplyObject(reply);
|
||||||
|
}
|
||||||
|
|
||||||
/* Config dump */
|
/* Config dump */
|
||||||
UpdateAllConfigObjects();
|
UpdateAllConfigObjects();
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ class RedisWriter : ConfigObject
|
||||||
};
|
};
|
||||||
[config] String path;
|
[config] String path;
|
||||||
[config] String password;
|
[config] String password;
|
||||||
|
[config] int db_index;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue