Skip to content

Commit

Permalink
Rename endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
vladsavelyev committed Feb 21, 2024
1 parent abc1629 commit b77ab1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_download_stats(
return session.exec(statement).all()


def insert_usage_stats(visit_stats: pd.DataFrame):
def insert_visit_stats(visit_stats: pd.DataFrame):
with Session(engine) as session:
for index, row in visit_stats.iterrows():
new_entry = VisitStats(**row)
Expand Down
3 changes: 1 addition & 2 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from typing import List, Dict

import sys
Expand Down Expand Up @@ -225,7 +224,7 @@ def _summarize_visits(interval="5min") -> Response:
f"Summarizing {len(df)} visits in {CSV_FILE_PATH} and writing {len(interval_summary)} rows to the DB"
)
try:
db.insert_usage_stats(interval_summary)
db.insert_visit_stats(interval_summary)
except Exception as e:
return PlainTextResponse(
status_code=http.HTTPStatus.INTERNAL_SERVER_ERROR,
Expand Down

0 comments on commit b77ab1b

Please sign in to comment.