Skip to content

Commit

Permalink
🥳 修复data:结尾代码输出出现异常问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanyutin753 committed Sep 29, 2024
1 parent ba26e9c commit 3b4f0d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ def data_fetcher(upstream_response, data_queue, stop_event, last_data_time, api_
end_index = buffer.index('\n\n') + 2
complete_data, buffer = buffer[:end_index], buffer[end_index:]
try:
data_content = complete_data.replace('data: ', '').strip()
data_content = re.sub(r'^data:\s*', '', complete_data).strip()
if not data_content:
continue
data_json = json.loads(data_content)
Expand Down

0 comments on commit 3b4f0d4

Please sign in to comment.