cluster: Fix crash bug.

This commit is contained in:
Gunnar Beutner 2013-09-03 11:00:57 +02:00
parent b97e69604d
commit 1b31ced475
1 changed files with 9 additions and 7 deletions

View File

@ -215,14 +215,16 @@ void ClusterComponent::RelayMessage(const Endpoint::Ptr& except, const Dictionar
pmessage->Set("message", message);
ObjectLock olock(this);
String json = Value(pmessage).Serialize();
NetString::WriteStringToStream(m_LogFile, json);
m_LogMessageCount++;
m_LogMessageTimestamp = ts;
if (m_LogFile) {
String json = Value(pmessage).Serialize();
NetString::WriteStringToStream(m_LogFile, json);
m_LogMessageCount++;
m_LogMessageTimestamp = ts;
if (m_LogMessageCount > 250000) {
CloseLogFile();
OpenLogFile();
if (m_LogMessageCount > 250000) {
CloseLogFile();
OpenLogFile();
}
}
}