diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2018-09-14 03:11:25 +1000 |
---|---|---|
committer | Amber Brown <hawkowl@atleastfornow.net> | 2018-09-14 03:11:25 +1000 |
commit | 73884ebac59f091ac44cf81b7fb8854cdd4a3785 (patch) | |
tree | 63890fa9d273b69a19fa581e1dce83eb4ab55b38 /synapse/push | |
parent | buffer? (diff) | |
parent | merge (#3576) (diff) | |
download | synapse-73884ebac59f091ac44cf81b7fb8854cdd4a3785.tar.xz |
Merge remote-tracking branch 'origin/develop' into hawkowl/timeouts-2
Diffstat (limited to 'synapse/push')
-rw-r--r-- | synapse/push/httppusher.py | 7 | ||||
-rw-r--r-- | synapse/push/mailer.py | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/synapse/push/httppusher.py b/synapse/push/httppusher.py index 81e18bcf7d..48abd5e4d6 100644 --- a/synapse/push/httppusher.py +++ b/synapse/push/httppusher.py @@ -15,6 +15,8 @@ # limitations under the License. import logging +import six + from prometheus_client import Counter from twisted.internet import defer @@ -26,6 +28,9 @@ from synapse.util.metrics import Measure from . import push_rule_evaluator, push_tools +if six.PY3: + long = int + logger = logging.getLogger(__name__) http_push_processed_counter = Counter("synapse_http_httppusher_http_pushes_processed", "") @@ -96,7 +101,7 @@ class HttpPusher(object): @defer.inlineCallbacks def on_new_notifications(self, min_stream_ordering, max_stream_ordering): - self.max_stream_ordering = max(max_stream_ordering, self.max_stream_ordering) + self.max_stream_ordering = max(max_stream_ordering, self.max_stream_ordering or 0) yield self._process() @defer.inlineCallbacks diff --git a/synapse/push/mailer.py b/synapse/push/mailer.py index bfa6df7b68..b78ce10396 100644 --- a/synapse/push/mailer.py +++ b/synapse/push/mailer.py @@ -17,10 +17,11 @@ import email.mime.multipart import email.utils import logging import time -import urllib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText +from six.moves import urllib + import bleach import jinja2 @@ -474,7 +475,7 @@ class Mailer(object): # XXX: make r0 once API is stable return "%s_matrix/client/unstable/pushers/remove?%s" % ( self.hs.config.public_baseurl, - urllib.urlencode(params), + urllib.parse.urlencode(params), ) @@ -561,7 +562,7 @@ def _create_mxc_to_http_filter(config): return "%s_matrix/media/v1/thumbnail/%s?%s%s" % ( config.public_baseurl, serverAndMediaId, - urllib.urlencode(params), + urllib.parse.urlencode(params), fragment or "", ) |