Enhance processChunks by attempting to recover by processing the next chunk.
This commit is contained in:
parent
e455840ab3
commit
cb0422b8f2
|
@ -609,6 +609,9 @@ export function processChunks(
|
||||||
chunks.shift();
|
chunks.shift();
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} 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");
|
console.warn("Failed to process chunk, attempting recovery");
|
||||||
// Attempt to recover by processing the next chunk
|
// Attempt to recover by processing the next chunk
|
||||||
if (chunks.length > 1) {
|
if (chunks.length > 1) {
|
||||||
|
@ -618,6 +621,7 @@ export function processChunks(
|
||||||
// If this is the last chunk, throw to prevent data loss
|
// If this is the last chunk, throw to prevent data loss
|
||||||
throw new Error("Failed to process final chunk");
|
throw new Error("Failed to process final chunk");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue