fix: The workflow cannot function properly after the conversation flow is disconnected (#2428)
This commit is contained in:
parent
c433c03fc0
commit
afaf3d6e26
@ -382,6 +382,8 @@ class WorkflowManage:
|
|||||||
break
|
break
|
||||||
yield chunk
|
yield chunk
|
||||||
finally:
|
finally:
|
||||||
|
while self.is_run():
|
||||||
|
pass
|
||||||
details = self.get_runtime_details()
|
details = self.get_runtime_details()
|
||||||
message_tokens = sum([row.get('message_tokens') for row in details.values() if
|
message_tokens = sum([row.get('message_tokens') for row in details.values() if
|
||||||
'message_tokens' in row and row.get('message_tokens') is not None])
|
'message_tokens' in row and row.get('message_tokens') is not None])
|
||||||
|
|||||||
@ -44,10 +44,10 @@ class GZipMiddleware(MiddlewareMixin):
|
|||||||
if response.is_async:
|
if response.is_async:
|
||||||
# pull to lexical scope to capture fixed reference in case
|
# pull to lexical scope to capture fixed reference in case
|
||||||
# streaming_content is set again later.
|
# streaming_content is set again later.
|
||||||
orignal_iterator = response.streaming_content
|
original_iterator = response.streaming_content
|
||||||
|
|
||||||
async def gzip_wrapper():
|
async def gzip_wrapper():
|
||||||
async for chunk in orignal_iterator:
|
async for chunk in original_iterator:
|
||||||
yield compress_string(
|
yield compress_string(
|
||||||
chunk,
|
chunk,
|
||||||
max_random_bytes=self.max_random_bytes,
|
max_random_bytes=self.max_random_bytes,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user