mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-09 07:42:38 +02:00
Merge branch 'fix-stream-report-error' into 'mgx_ops'
stop stream report if CancelledError See merge request pub/MetaGPT!403
This commit is contained in:
commit
6e5dfc1ca4
1 changed files with 2 additions and 2 deletions
|
|
@ -165,9 +165,9 @@ class ResourceReporter(BaseModel):
|
|||
self._llm_task = asyncio.create_task(self._llm_stream_report(queue))
|
||||
return self
|
||||
|
||||
async def __aexit__(self, *args, **kwargs):
|
||||
async def __aexit__(self, exc_type, exc_value, exc_tb):
|
||||
"""Exit the asynchronous streaming callback context."""
|
||||
if self.enable_llm_stream:
|
||||
if self.enable_llm_stream and exc_type != asyncio.CancelledError:
|
||||
await get_llm_stream_queue().put(None)
|
||||
await self._llm_task
|
||||
self._llm_task = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue