feat: change update chunking

This commit is contained in:
2026-05-19 09:50:28 +02:00
parent 8c61468710
commit 67b7c687df
+8 -3
View File
@@ -573,12 +573,17 @@ export class CharaDevice {
return it;
});
const chunkSize = 128;
const chunkSize = 1024;
const promises = [];
for (let i = 0; i < file.byteLength; i += chunkSize) {
const chunk = file.slice(i, i + chunkSize);
await writer.write(new Uint8Array(chunk));
progress(i + chunk.byteLength, file.byteLength);
promises.push(
writer
.write(new Uint8Array(chunk))
.then(() => progress(i + chunk.byteLength, file.byteLength)),
);
}
await Promise.all(promises);
serialLog.update((it) => {
it.push({