File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 88from __future__ import annotations
99
1010from ast import literal_eval
11+ from datetime import timedelta
1112import inspect
1213import itertools
1314import logging
15+ import math
1416import re
1517import threading
1618import time
@@ -631,7 +633,11 @@ def rate_limit_info(
631633 return False , None
632634
633635 next_time = metrics .last_time + rate_limit
634- time_left = next_time - at_time
636+ time_left = timedelta (
637+ seconds = math .ceil (
638+ (next_time - at_time ).total_seconds ()
639+ )
640+ )
635641
636642 message : Optional [str ] = None
637643
Original file line number Diff line number Diff line change @@ -1174,8 +1174,8 @@ def testrule(bot, trigger):
11741174 # assert there is now a NOTICE which contains templated time left information
11751175 assert mockbot .backend .message_sent
11761176 patt = (br"NOTICE Test :"
1177- br"time_left=\d+:\d+:\d+(\.\d+)? "
1178- br"time_left_sec=\d+(\.\d+)? " )
1177+ br"time_left=\d+:\d+:\d+ "
1178+ br"time_left_sec=\d+" )
11791179 assert re .match (patt , mockbot .backend .message_sent [0 ])
11801180
11811181
You can’t perform that action at this time.
0 commit comments