Skip to content

Commit

Permalink
log
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj committed Sep 2, 2024
1 parent 370cde2 commit 5b12989
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openhands/events/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,12 @@ def get_latest_event_id(self) -> int:
def subscribe(self, id: EventStreamSubscriber, callback: Callable, append=False):
if id in self._subscribers:
if append:
logger.info(f'Appending callback to subscriber {id}')
logger.debug(f'Appending callback to subscriber {id}')
self._subscribers[id].append(callback)
else:
raise ValueError('Subscriber already exists: ' + id)
else:
logger.debug(f'Subscribing to {id}')
self._subscribers[id] = [callback]

def unsubscribe(self, id: EventStreamSubscriber):
Expand Down

0 comments on commit 5b12989

Please sign in to comment.