diff --git a/main.py b/main.py index f2ce860..337a56a 100644 --- a/main.py +++ b/main.py @@ -231,6 +231,8 @@ class LabCleaningBot: print("Websockets connection closed. Reestablishing connection.") async def sync_members_and_tasks(self, session: Session): + unfulfillable_tasks = [] + while True: sync_result = self.sync_members_as_active_users(session) @@ -243,12 +245,15 @@ class LabCleaningBot: reqs = task.create_additional_requests(utc_now(), session) if is_err(reqs): - res = self.send_to_base_group("Could not fulfill task: " + task.name) + if task not in unfulfillable_tasks: + res = self.send_to_base_group("Could not fulfill task: " + task.name) - if is_err(res): - print(res.unwrap_err()) - else: - print(res.unwrap()) + unfulfillable_tasks.append(task) + + if is_err(res): + print(res.unwrap_err()) + else: + print(res.unwrap()) reqs = reqs.unwrap_err() else: