Skip to content

Commit 152a4ab

Browse files
author
Dylan Huang
committed
simple solution to updating the client
1 parent 0fb7071 commit 152a4ab

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

eval_protocol/utils/logs_server.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,18 @@ def broadcast_file_update(self, update_type: str, file_path: str):
9797
return
9898
logger.info(f"Broadcasting file update: {update_type} {file_path}")
9999

100+
logs = default_logger.read()
101+
# send initialize_logs message to all connected clients
102+
for connection in self.active_connections:
103+
asyncio.run_coroutine_threadsafe(
104+
connection.send_text(
105+
json.dumps(
106+
{"type": "initialize_logs", "logs": [log.model_dump_json(exclude_none=True) for log in logs]}
107+
)
108+
),
109+
self._loop,
110+
)
111+
100112
message = {"type": update_type, "path": file_path, "timestamp": time.time()}
101113
# Include file contents for created and modified events
102114
if update_type in ["file_created", "file_changed"] and os.path.exists(file_path):

0 commit comments

Comments
 (0)