mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-24 20:03:41 +03:00
fix(notifications): dead notifications that are still present long after (#1186)
This commit is contained in:
parent
86c10bd14d
commit
f847ee84a9
@ -1,3 +1,4 @@
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
|
||||
@ -115,10 +116,13 @@ class Notifications(Repository):
|
||||
Returns:
|
||||
list[Notification]: The notifications
|
||||
"""
|
||||
five_minutes_ago = datetime.now() - timedelta(minutes=5)
|
||||
|
||||
notifications = (
|
||||
self.db.from_("notifications")
|
||||
.select("*")
|
||||
.filter("chat_id", "eq", chat_id)
|
||||
.filter("datetime", "lt", five_minutes_ago)
|
||||
.execute()
|
||||
).data
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user