mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Hook up adding a pusher to the notifier for replication.
This commit is contained in:
parent
b6e8420aee
commit
12904932c4
@ -282,6 +282,12 @@ class Notifier(object):
|
||||
|
||||
self.notify_replication()
|
||||
|
||||
def on_new_replication_data(self):
|
||||
"""Used to inform replication listeners that something has happend
|
||||
without waking up any of the normal user event streams"""
|
||||
with PreserveLoggingContext():
|
||||
self.notify_replication()
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def wait_for_events(self, user_id, timeout, callback, room_ids=None,
|
||||
from_token=StreamToken.START):
|
||||
|
@ -29,6 +29,10 @@ logger = logging.getLogger(__name__)
|
||||
class PusherRestServlet(ClientV1RestServlet):
|
||||
PATTERNS = client_path_patterns("/pushers/set$")
|
||||
|
||||
def __init__(self, hs):
|
||||
super(PusherRestServlet, self).__init__(hs)
|
||||
self.notifier = hs.get_notifier()
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def on_POST(self, request):
|
||||
requester = yield self.auth.get_user_by_req(request)
|
||||
@ -87,6 +91,8 @@ class PusherRestServlet(ClientV1RestServlet):
|
||||
raise SynapseError(400, "Config Error: " + pce.message,
|
||||
errcode=Codes.MISSING_PARAM)
|
||||
|
||||
self.notifier.on_new_replication_data()
|
||||
|
||||
defer.returnValue((200, {}))
|
||||
|
||||
def on_OPTIONS(self, _):
|
||||
|
Loading…
Reference in New Issue
Block a user