mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
move get_all_pushers call down
simplifies the interface to _start_pushers
This commit is contained in:
parent
04277d0ed8
commit
5110f4e425
@ -36,8 +36,7 @@ class PusherPool:
|
|||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def start(self):
|
def start(self):
|
||||||
pushers = yield self.store.get_all_pushers()
|
yield self._start_pushers()
|
||||||
self._start_pushers(pushers)
|
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def add_pusher(self, user_id, access_token, kind, app_id,
|
def add_pusher(self, user_id, access_token, kind, app_id,
|
||||||
@ -207,10 +206,17 @@ class PusherPool:
|
|||||||
if p:
|
if p:
|
||||||
self._start_pusher(p)
|
self._start_pusher(p)
|
||||||
|
|
||||||
def _start_pushers(self, pushers):
|
@defer.inlineCallbacks
|
||||||
|
def _start_pushers(self):
|
||||||
|
"""Start all the pushers
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Deferred
|
||||||
|
"""
|
||||||
if not self.start_pushers:
|
if not self.start_pushers:
|
||||||
logger.info("Not starting pushers because they are disabled in the config")
|
logger.info("Not starting pushers because they are disabled in the config")
|
||||||
return
|
return
|
||||||
|
pushers = yield self.store.get_all_pushers()
|
||||||
logger.info("Starting %d pushers", len(pushers))
|
logger.info("Starting %d pushers", len(pushers))
|
||||||
for pusherdict in pushers:
|
for pusherdict in pushers:
|
||||||
self._start_pusher(pusherdict)
|
self._start_pusher(pusherdict)
|
||||||
|
Loading…
Reference in New Issue
Block a user