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

Update usage record when GitAuto asks back to users and finishes there #382

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions services/gitauto_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,14 @@ async def handle_gitauto(payload: GitHubLabeledPayload, trigger_type: str) -> No
messages=messages, base_args=base_args, mode="comment"
)
if is_commented:
end_time = time.time()
supabase_manager.complete_and_update_usage_record(
hiroshinishio marked this conversation as resolved.
Show resolved Hide resolved
usage_record_id=usage_record_id,
is_completed=True, # False is only for GitAuto's failure
token_input=token_input,
token_output=token_output,
total_seconds=int(end_time - current_time),
)
return

# Create a remote branch
Expand Down