mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-22 13:40:16 +09:00
Update app/utils/aws.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
19437c7aa1
commit
e455840ab3
@ -609,10 +609,15 @@ export function processChunks(
|
||||
chunks.shift();
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("[Chunk Process Error]:", e);
|
||||
chunks.shift(); // Remove error chunk
|
||||
pendingChunk = null; // Reset pending chunk on error
|
||||
}
|
||||
console.warn("Failed to process chunk, attempting recovery");
|
||||
// Attempt to recover by processing the next chunk
|
||||
if (chunks.length > 1) {
|
||||
chunks.shift();
|
||||
pendingChunk = null;
|
||||
} else {
|
||||
// If this is the last chunk, throw to prevent data loss
|
||||
throw new Error("Failed to process final chunk");
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user