Commit 4ba4df92 authored by Julien Muchembled's avatar Julien Muchembled

Do not frighten the user when a connection between 2 replicating nodes is closed

Connection closure is either wanted by the replication node (-> no log)
or not serious (-> warning).

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2796 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 3c034eca
...@@ -80,14 +80,15 @@ class ReplicationHandler(EventHandler): ...@@ -80,14 +80,15 @@ class ReplicationHandler(EventHandler):
"""This class handles events for replications.""" """This class handles events for replications."""
def connectionLost(self, conn, new_state): def connectionLost(self, conn, new_state):
neo.lib.logging.error(
'replication is stopped due to a connection lost')
replicator = self.app.replicator replicator = self.app.replicator
if replicator.isCurrentConnection(conn): if replicator.isCurrentConnection(conn):
if replicator.pending():
neo.lib.logging.warning(
'replication is stopped due to a connection lost')
replicator.storageLost() replicator.storageLost()
def connectionFailed(self, conn): def connectionFailed(self, conn):
neo.lib.logging.error( neo.lib.logging.warning(
'replication is stopped due to connection failure') 'replication is stopped due to connection failure')
self.app.replicator.storageLost() self.app.replicator.storageLost()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment