diff --git a/bots/zephyr_mirror_backend.py b/bots/zephyr_mirror_backend.py index 386e078..6ee08b2 100755 --- a/bots/zephyr_mirror_backend.py +++ b/bots/zephyr_mirror_backend.py @@ -38,6 +38,7 @@ import optparse import os import datetime import textwrap +import time import signal import logging import hashlib @@ -762,8 +763,8 @@ def maybe_forward_to_zephyr(message): # Don't try forward private messages with non-MIT users # to MIT Zephyr. return - timestamp_now = datetime.datetime.now().strftime("%s") - if float(message["timestamp"]) < float(timestamp_now) - 15: + timestamp_now = int(time.time()) + if float(message["timestamp"]) < timestamp_now - 15: logger.warning("Skipping out of order message: %s < %s" % (message["timestamp"], timestamp_now)) return