Skip to content

Commit

Permalink
fixed for threading
Browse files Browse the repository at this point in the history
  • Loading branch information
HowieG committed Sep 14, 2024
1 parent 3edb4e8 commit d81695d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions agentops/time_travel.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
from .http_client import HttpClient
from .exceptions import ApiServerException
from .singleton import singleton
import threading

_time_travel_lock = threading.Lock()


@singleton
Expand Down Expand Up @@ -160,8 +163,9 @@ def set_time_travel_active_state(is_active: bool):


def add_time_travel_terminal_indicator():
if TimeTravel()._initialized is False:
print(f"🖇⏰ AgentOps: Time Travel Activated")
with _time_travel_lock:
if not TimeTravel()._initialized:
print(f"🖇⏰ AgentOps: Time Travel Activated")


def reset_terminal():
Expand Down

0 comments on commit d81695d

Please sign in to comment.