mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-22 21:50: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();
|
chunks.shift();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("[Chunk Process Error]:", e);
|
console.warn("Failed to process chunk, attempting recovery");
|
||||||
chunks.shift(); // Remove error chunk
|
// Attempt to recover by processing the next chunk
|
||||||
pendingChunk = null; // Reset pending chunk on error
|
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 {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user