Skip to content

Commit

Permalink
send end timestamp if not set before record
Browse files Browse the repository at this point in the history
  • Loading branch information
bboynton97 committed May 2, 2024
1 parent 139488a commit d397547
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion agentops/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ def record(self, event: Event | ErrorEvent):
Args:
event (Event): The event to record.
"""

if not event.end_timestamp or event.init_timestamp == event.end_timestamp:
event.end_timestamp = get_ISO_time()
if self._session is not None and not self._session.has_ended:
if isinstance(event, ErrorEvent):
if event.trigger_event:
Expand Down

0 comments on commit d397547

Please sign in to comment.