server: Only set the lag from the response if it's less than the current lag.

This commit is contained in:
Damir Jelić 2019-01-24 11:55:31 +01:00
parent 92ff15943c
commit fa0d870deb

View file

@ -1267,9 +1267,12 @@ class MatrixServer(object):
def handle_response(self, response):
# type: (Response) -> None
self.lag = response.elapsed * 1000
self.lag_done = True
W.bar_item_update("lag")
response_lag = response.elapsed
if response_lag >= self.client.lag:
self.lag = response_lag * 1000
self.lag_done = True
W.bar_item_update("lag")
if isinstance(response, ErrorResponse):
self.handle_error_response(response)