worker-fix
All checks were successful
deploy / deploy (push) Successful in 1m12s

This commit is contained in:
2023-11-26 22:36:02 +03:00
parent bf3a8bcc0c
commit 7ea2a911ef
2 changed files with 14 additions and 22 deletions

View File

@@ -1,4 +1,5 @@
import json
import asyncio
from orm.notification import Notification
from services.db import local_session
@@ -19,9 +20,5 @@ async def handle_reaction(notification: dict[str, str | int]):
async def reactions_worker():
async for message in redis.listen("reaction"):
message = await message
if message:
msg_data = message.get("data")
if msg_data:
msg = json.loads(msg_data)
await handle_reaction(msg)
await handle_reaction(message)