From ebbadb0aebefed5e85cb0d9561fcb482c8e57c2f Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Mon, 1 Jul 2024 15:13:01 +0200 Subject: [PATCH] fix: [backend:db] Usage of notification buffer size --- db.py | 6 +++++- notification.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/db.py b/db.py index 4fd3099..e27ca07 100644 --- a/db.py +++ b/db.py @@ -13,4 +13,8 @@ INJECT_REQUIREMENTS_BY_INJECT_UUID = {} EXERCISES_STATUS = {} PROGRESS = { } -NOTIFICATION_MESSAGES = collections.deque([], 30) \ No newline at end of file +NOTIFICATION_BUFFER_SIZE = 30 +NOTIFICATION_MESSAGES = collections.deque([], NOTIFICATION_BUFFER_SIZE) + +def resetNotificationMessage(): + NOTIFICATION_MESSAGES = collections.deque([], NOTIFICATION_BUFFER_SIZE) \ No newline at end of file diff --git a/notification.py b/notification.py index 6abca94..7c0b34e 100644 --- a/notification.py +++ b/notification.py @@ -21,7 +21,7 @@ def get_notifications() -> list[dict]: def reset_notifications(): - db.NOTIFICATION_MESSAGES = [] + db.resetNotificationMessage() def record_notification(notification: dict):