Skip to content

Commit

Permalink
test article
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Lobanov committed Nov 4, 2023
1 parent 2131618 commit 94fb27d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
10 changes: 10 additions & 0 deletions resolvers/zine/load.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
from datetime import datetime, timedelta, timezone

from sqlalchemy.orm import aliased, joinedload
Expand Down Expand Up @@ -79,6 +80,15 @@ def apply_filters(q, filters, user_id=None): # noqa: C901

@query.field("loadShout")
async def load_shout(_, info, slug=None, shout_id=None):
# for testing, soon will be removed
if slug == "testtesttest":
with open("test/test.json") as json_file:
test_shout = json.load(json_file)["data"]["loadShout"]
test_shout["createdAt"] = datetime.fromisoformat(test_shout["createdAt"])
test_shout["publishedAt"] = datetime.fromisoformat(test_shout["publishedAt"])
print(test_shout)
return test_shout

with local_session() as session:
q = select(Shout).options(
joinedload(Shout.authors),
Expand Down
2 changes: 1 addition & 1 deletion services/notifications/notification_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ async def run(self):

class NotificationService:
def __init__(self):
self._queue = asyncio.Queue()
self._queue = asyncio.Queue(maxsize=1000)

async def handle_new_reaction(self, reaction_id):
notificator = NewReactionNotificator(reaction_id)
Expand Down
Loading

0 comments on commit 94fb27d

Please sign in to comment.