race-fix8
This commit is contained in:
parent
55c75f2a2e
commit
4d79334dbc
|
@ -8,8 +8,6 @@ from .chats import create_chat
|
||||||
from .unread import get_unread_counter
|
from .unread import get_unread_counter
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
lock = asyncio.Lock()
|
|
||||||
|
|
||||||
|
|
||||||
# NOTE: not an API handler
|
# NOTE: not an API handler
|
||||||
async def load_messages(chat_id: str, limit: int = 5, offset: int = 0, ids=None):
|
async def load_messages(chat_id: str, limit: int = 5, offset: int = 0, ids=None):
|
||||||
|
@ -52,6 +50,7 @@ async def load_chats(_, info, limit: int = 50, offset: int = 0):
|
||||||
cids = cids[offset:(offset + limit)]
|
cids = cids[offset:(offset + limit)]
|
||||||
members_online = (await redis.execute("SMEMBERS", "authors-online")) or []
|
members_online = (await redis.execute("SMEMBERS", "authors-online")) or []
|
||||||
chats = []
|
chats = []
|
||||||
|
lock = asyncio.Lock()
|
||||||
if len(cids) == 0:
|
if len(cids) == 0:
|
||||||
print(f"[resolvers.load] no chats for user with id={author_id}, create one with Discours (id=2)")
|
print(f"[resolvers.load] no chats for user with id={author_id}, create one with Discours (id=2)")
|
||||||
r = await create_chat(None, info, members=[2]) # member with id = 2 is discours
|
r = await create_chat(None, info, members=[2]) # member with id = 2 is discours
|
||||||
|
|
Loading…
Reference in New Issue
Block a user