precreate-tables-fix
Some checks failed
deploy / deploy (push) Has been cancelled

This commit is contained in:
2024-01-22 22:05:19 +03:00
parent 736569930b
commit 5ab5928d12
3 changed files with 33 additions and 7 deletions

View File

@@ -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,