This commit is contained in:
@@ -12,6 +12,10 @@ import time, json
|
||||
import strawberry
|
||||
from sqlalchemy.orm import aliased
|
||||
from sqlalchemy import select, and_
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger("[resolvers.schema] ")
|
||||
logger.setLevel(logging.DEBUG)
|
||||
|
||||
|
||||
async def get_notifications_grouped(author_id: int, after: int = 0, limit: int = 10, offset: int = 0):
|
||||
@@ -61,11 +65,11 @@ async def get_notifications_grouped(author_id: int, after: int = 0, limit: int =
|
||||
for n, seen in notifications_result:
|
||||
thread_id = ""
|
||||
payload = json.loads(n.payload)
|
||||
print(f"[resolvers.schema] {n.action} {n.entity}: {payload}")
|
||||
logger.debug(f"[resolvers.schema] {n.action} {n.entity}: {payload}")
|
||||
if n.entity == "shout" and n.action == "create":
|
||||
shout: NotificationShout = payload
|
||||
thread_id += f"{shout.id}"
|
||||
print(f"[resolvers.schema] create shout: {shout}")
|
||||
logger.debug(f"create shout: {shout}")
|
||||
group = groups_by_thread.get(thread_id) or NotificationGroup(
|
||||
id=thread_id,
|
||||
entity=n.entity,
|
||||
|
Reference in New Issue
Block a user