Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphの情報取得料をへらす #45

Merged
merged 1 commit into from Aug 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions python/main.py
Expand Up @@ -288,9 +288,11 @@ def generate_isu_graph_response(jia_isu_uuid: str, graph_date: datetime) -> list
conditions_in_this_hour = []
timestamps_in_this_hour = []
start_time_in_this_hour = None
start_time_of_this_day = graph_date
end_time_of_this_day = graph_date + 86400 # 1日分

query = "SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = %s ORDER BY `timestamp` ASC"
rows = select_all(cnxpool, query, (jia_isu_uuid,))
query = "SELECT * FROM `isu_condition` WHERE `jia_isu_uuid` = %s and `timestamp` >= %s and timestamp =< %s ORDER BY `timestamp` ASC"
rows = select_all(cnxpool, query, (jia_isu_uuid, start_time_of_this_day, end_time_of_this_day))
for row in rows:
condition = IsuCondition(**row)
# condition情報の時刻を時間単位に切り捨てる
Expand Down