Merge branch 'get-author-get-topic-fix' into dokku-main
This commit is contained in:
commit
347e8ffdc3
5
CHECKS
Normal file
5
CHECKS
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
WAIT=30
|
||||||
|
TIMEOUT=10
|
||||||
|
ATTEMPTS=60 # 60 * 30 = 30 min
|
||||||
|
|
||||||
|
/ Playground
|
28
Dockerfile
28
Dockerfile
|
@ -1,15 +1,13 @@
|
||||||
FROM python:3.8
|
FROM python:3.8
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
RUN /usr/local/bin/python -m pip install --upgrade pip
|
RUN /usr/local/bin/python -m pip install --upgrade pip
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
COPY requirements.txt ./
|
COPY requirements.txt ./
|
||||||
|
|
||||||
RUN set -ex && pip install -r requirements.txt
|
RUN set -ex && pip install -r requirements.txt
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
CMD ["python", "server.py"]
|
|
||||||
|
|
|
@ -213,6 +213,6 @@ def get_top_authors(_, _info, offset, limit):
|
||||||
|
|
||||||
@query.field("getAuthor")
|
@query.field("getAuthor")
|
||||||
async def get_author(_, _info, slug):
|
async def get_author(_, _info, slug):
|
||||||
a = await UserStorage.users[slug]
|
a = await UserStorage.get_user_by_slug(slug)
|
||||||
a.stat = get_author_stat(slug)
|
a.stat = await get_author_stat(slug)
|
||||||
return a
|
return a
|
||||||
|
|
|
@ -55,8 +55,8 @@ async def topics_by_author(_, _info, author):
|
||||||
|
|
||||||
@query.field("getTopic")
|
@query.field("getTopic")
|
||||||
async def get_topic(_, _info, slug):
|
async def get_topic(_, _info, slug):
|
||||||
t = await TopicStorage.topics[slug]
|
t = TopicStorage.topics[slug]
|
||||||
t.stat = get_topic_stat(slug)
|
t.stat = await get_topic_stat(slug)
|
||||||
return t
|
return t
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user