Skip to content

Commit

Permalink
Update usage record when GitAuto asks back to users and finishes there
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroshinishio committed Nov 18, 2024
1 parent fe93c3d commit 869f206
Showing 1 changed file with 8 additions and 0 deletions.
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(
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

0 comments on commit 869f206

Please sign in to comment.