summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-03-29 11:41:37 +0100
committerGitHub <noreply@github.com>2017-03-29 11:41:37 +0100
commitc5b0bdd5421bd503d79a3159cc1551af89508ab1 (patch)
treee52b7f5015b50b8c2fba4451e5d7e8ddf1bb12be
parentMerge pull request #2037 from ricco386/fix_readme_centos_issues (diff)
parentNotify on new federation traffic (diff)
downloadsynapse-c5b0bdd5421bd503d79a3159cc1551af89508ab1.tar.xz
Merge pull request #2067 from matrix-org/erikj/notify_on_fed
Notify on new federation traffic
-rw-r--r--synapse/federation/send_queue.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/federation/send_queue.py b/synapse/federation/send_queue.py
index 5c9f7a86f0..bbb0195228 100644
--- a/synapse/federation/send_queue.py
+++ b/synapse/federation/send_queue.py
@@ -54,6 +54,7 @@ class FederationRemoteSendQueue(object):
     def __init__(self, hs):
         self.server_name = hs.hostname
         self.clock = hs.get_clock()
+        self.notifier = hs.get_notifier()
 
         self.presence_map = {}
         self.presence_changed = sorteddict()
@@ -186,6 +187,8 @@ class FederationRemoteSendQueue(object):
         else:
             self.edus[pos] = edu
 
+        self.notifier.on_new_replication_data()
+
     def send_presence(self, destination, states):
         """As per TransactionQueue"""
         pos = self._next_pos()
@@ -199,16 +202,20 @@ class FederationRemoteSendQueue(object):
             (destination, state.user_id) for state in states
         ]
 
+        self.notifier.on_new_replication_data()
+
     def send_failure(self, failure, destination):
         """As per TransactionQueue"""
         pos = self._next_pos()
 
         self.failures[pos] = (destination, str(failure))
+        self.notifier.on_new_replication_data()
 
     def send_device_messages(self, destination):
         """As per TransactionQueue"""
         pos = self._next_pos()
         self.device_messages[pos] = destination
+        self.notifier.on_new_replication_data()
 
     def get_current_token(self):
         return self.pos - 1