Commenting an obscure loop in the Timed Message service

main
Nicolas Ong 2024-01-31 10:43:29 +01:00
parent 484e042e17
commit f2dee18079
1 changed files with 1 additions and 0 deletions

View File

@ -75,6 +75,7 @@ class TimedMessageService(Service):
for msg_id in self.messages: for msg_id in self.messages:
new_time = starting_time + timedelta(minutes = self.messages[msg_id]["interval"]) new_time = starting_time + timedelta(minutes = self.messages[msg_id]["interval"])
formatted = new_time.strftime("%H:%M") formatted = new_time.strftime("%H:%M")
# avoids two messages to spawn at the same time, inducing a 3 minutes delay
while formatted in times: while formatted in times:
new_time += timedelta(minutes = 3) new_time += timedelta(minutes = 3)
formatted = new_time.strftime("%H:%M") formatted = new_time.strftime("%H:%M")