Skip to content

Commit 7884e82

Browse files
committed
Use event loop time for result timestamp
Replaced the UUID-based timestamp with the event loop's time from asyncio for the final result message. This provides a more accurate and relevant timestamp for message completion.
1 parent c251672 commit 7884e82

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/v3/orchestration/orchestration_manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) Microsoft. All rights reserved.
22
""" Orchestration manager to handle the orchestration logic. """
33

4+
import asyncio
45
import contextvars
56
import os
67
import uuid
@@ -139,7 +140,7 @@ async def run_orchestration(self, user_id, input_task) -> None:
139140
"data": {
140141
"content": str(value),
141142
"status": "completed",
142-
"timestamp": str(uuid.uuid4()) # or use actual timestamp
143+
"timestamp": asyncio.get_event_loop().time()
143144
}
144145
}, user_id, message_type=WebsocketMessageType.FINAL_RESULT_MESSAGE)
145146
print(f"Final result sent via WebSocket to user {user_id}")

0 commit comments

Comments
 (0)