fix: [backend:db] Usage of notification buffer size

This commit is contained in:
Sami Mokaddem 2024-07-01 15:13:01 +02:00
parent ac28be543f
commit ebbadb0aeb
2 changed files with 6 additions and 2 deletions

6
db.py
View file

@ -13,4 +13,8 @@ INJECT_REQUIREMENTS_BY_INJECT_UUID = {}
EXERCISES_STATUS = {}
PROGRESS = {
}
NOTIFICATION_MESSAGES = collections.deque([], 30)
NOTIFICATION_BUFFER_SIZE = 30
NOTIFICATION_MESSAGES = collections.deque([], NOTIFICATION_BUFFER_SIZE)
def resetNotificationMessage():
NOTIFICATION_MESSAGES = collections.deque([], NOTIFICATION_BUFFER_SIZE)

View file

@ -21,7 +21,7 @@ def get_notifications() -> list[dict]:
def reset_notifications():
db.NOTIFICATION_MESSAGES = []
db.resetNotificationMessage()
def record_notification(notification: dict):