Skip to content

Commit

Permalink
updating to total_seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitamalinov committed Apr 25, 2024
1 parent 450a8cd commit 6d45d57
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion services/gitauto_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,6 @@ async def handle_gitauto(payload: GitHubLabeledPayload, trigger_type: str) -> No
usage_record_id=usage_record_id,
token_input=token_input,
token_output=token_output,
total_time=int(end_time - current_time),
total_seconds=int(end_time - current_time),
)
return
4 changes: 2 additions & 2 deletions services/supabase/gitauto_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def complete_and_update_usage_record(
usage_record_id: int,
token_input: int,
token_output: int,
total_time: int,
total_seconds: int,
) -> None:
"""Add agent information to usage record and set is_completed to True."""
try:
Expand All @@ -26,7 +26,7 @@ def complete_and_update_usage_record(
"is_completed": True,
"token_input": token_input,
"token_output": token_output,
"total_time": total_time,
"total_seconds": total_seconds,
}
).eq(column="id", value=usage_record_id).execute()
except Exception as e:
Expand Down
4 changes: 2 additions & 2 deletions tests/services/supabase/test_gitauto_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_create_update_user_request_works() -> None:
usage_record_id=usage_record_id,
token_input=1000,
token_output=100,
total_time=100,
total_seconds=100,
)
is None
)
Expand Down Expand Up @@ -119,7 +119,7 @@ def test_complete_and_update_usage_record_only_updates_one_record() -> None:
usage_record_id=usage_record_id,
token_input=1000,
token_output=100,
total_time=100,
total_seconds=100,
)
is None
)
Expand Down
2 changes: 1 addition & 1 deletion tests/services/supabase/test_users_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_create_and_update_user_request_works() -> None:
usage_record_id=usage_record_id,
token_input=1000,
token_output=100,
total_time=100,
total_seconds=100,
)
is None
)
Expand Down

0 comments on commit 6d45d57

Please sign in to comment.