summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/ServerCache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceGrid/ServerCache.cpp')
-rw-r--r--cpp/src/IceGrid/ServerCache.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/cpp/src/IceGrid/ServerCache.cpp b/cpp/src/IceGrid/ServerCache.cpp
index d6a320b68eb..4d998e9ab17 100644
--- a/cpp/src/IceGrid/ServerCache.cpp
+++ b/cpp/src/IceGrid/ServerCache.cpp
@@ -133,12 +133,15 @@ ServerEntryPtr
ServerCache::add(const ServerInfo& info)
{
Lock sync(*this);
- assert(!getImpl(info.descriptor->id));
-
- ServerEntryPtr entry = new ServerEntry(*this, info.descriptor->id);
- addImpl(info.descriptor->id, entry);
+ ServerEntryPtr entry = getImpl(info.descriptor->id);
+ if(!entry)
+ {
+ entry = new ServerEntry(*this, info.descriptor->id);
+ addImpl(info.descriptor->id, entry);
+ }
entry->update(info, false);
+
_nodeCache.get(info.node, true)->addServer(entry);
forEachCommunicator(AddCommunicator(*this, entry, info.application))(info.descriptor);