Skip to content

Commit

Permalink
Update Docker image, add TTT
Browse files Browse the repository at this point in the history
  • Loading branch information
Steeven9 committed Oct 28, 2023
1 parent fe1272c commit 2848aa9
Show file tree
Hide file tree
Showing 4 changed files with 907 additions and 783 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM python:alpine
FROM python:3-alpine

WORKDIR /usr/src/app
EXPOSE 5000
CMD [ "gunicorn", "main:app" ]
HEALTHCHECK CMD [ "curl", "localhost:5000/health" ]
# HEALTHCHECK --timeout=10s CMD [ "curl", "localhost:5000/health" ]

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
Expand Down
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def tweets_by_list(request: Request, talents: str) -> list[Tweet]:
summary="Get tweets for a specific fan server")
def tweets_server(request: Request,
server: str,
newestId: str = None) -> list[Tweet]:
newest_id: str = None) -> list[Tweet]:
if server.upper() == "KFP":
talents = talents_holo
elif server.upper() == "NEST":
Expand All @@ -228,8 +228,8 @@ def tweets_server(request: Request,
"$in": [talent["account"].lower() for talent in talents]
}
}
if newestId is not None:
db_filter["$expr"] = {"$gt": [{"$toLong": "$id"}, int(newestId)]}
if newest_id is not None:
db_filter["$expr"] = {"$gt": [{"$toLong": "$id"}, int(newest_id)]}
return list(
request.app.database["tweets"].find(db_filter).sort(SORTING_PARAM))

Expand Down
Loading

0 comments on commit 2848aa9

Please sign in to comment.