From 7455ba436a2903c8e6c9086c9ebe89f4c88af946 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Wed, 22 Feb 2017 12:08:14 +0000 Subject: [PATCH] Ensure we pass positive ints to delay function --- synapse/push/emailpusher.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/synapse/push/emailpusher.py b/synapse/push/emailpusher.py index 2eb325c7c..c7afd1111 100644 --- a/synapse/push/emailpusher.py +++ b/synapse/push/emailpusher.py @@ -218,7 +218,8 @@ class EmailPusher(object): ) def seconds_until(self, ts_msec): - return (ts_msec - self.clock.time_msec()) / 1000 + secs = (ts_msec - self.clock.time_msec()) / 1000 + return max(secs, 0) def get_room_throttle_ms(self, room_id): if room_id in self.throttle_params: