diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2018-06-25 14:08:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-25 14:08:28 +0100 |
commit | 07cad26d65dcf237643a43ff2bdfac73ca7a7257 (patch) | |
tree | 3532a82f5db52b278f7049dab9ddb53d5b3e3e25 /synapse/push | |
parent | Revert "Merge pull request #3431 from matrix-org/rav/erasure_visibility" (diff) | |
download | synapse-07cad26d65dcf237643a43ff2bdfac73ca7a7257.tar.xz |
Remove all global reactor imports & pass it around explicitly (#3424)
Diffstat (limited to 'synapse/push')
-rw-r--r-- | synapse/push/emailpusher.py | 4 | ||||
-rw-r--r-- | synapse/push/httppusher.py | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/synapse/push/emailpusher.py b/synapse/push/emailpusher.py index ba7286cb72..52d4f087ee 100644 --- a/synapse/push/emailpusher.py +++ b/synapse/push/emailpusher.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from twisted.internet import defer, reactor +from twisted.internet import defer from twisted.internet.error import AlreadyCalled, AlreadyCancelled import logging @@ -199,7 +199,7 @@ class EmailPusher(object): self.timed_call = None if soonest_due_at is not None: - self.timed_call = reactor.callLater( + self.timed_call = self.hs.get_reactor().callLater( self.seconds_until(soonest_due_at), self.on_timer ) diff --git a/synapse/push/httppusher.py b/synapse/push/httppusher.py index bf7ff74a1a..7a481b5a1e 100644 --- a/synapse/push/httppusher.py +++ b/synapse/push/httppusher.py @@ -15,7 +15,7 @@ # limitations under the License. import logging -from twisted.internet import defer, reactor +from twisted.internet import defer from twisted.internet.error import AlreadyCalled, AlreadyCancelled from . import push_rule_evaluator @@ -220,7 +220,9 @@ class HttpPusher(object): ) else: logger.info("Push failed: delaying for %ds", self.backoff_delay) - self.timed_call = reactor.callLater(self.backoff_delay, self.on_timer) + self.timed_call = self.hs.get_reactor().callLater( + self.backoff_delay, self.on_timer + ) self.backoff_delay = min(self.backoff_delay * 2, self.MAX_BACKOFF_SEC) break |