Skip to content

Commit a13da79

Browse files
committed
commit leftover xorb after all chunks have been processed
1 parent 2f9d4a0 commit a13da79

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/hub/src/utils/createXorbs.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,17 @@ export async function* createXorbs(
190190
sha256: fileSource.sha256,
191191
};
192192
}
193+
194+
if (xorbOffset > 0) {
195+
yield {
196+
type: "xorb" as const,
197+
xorb: xorb.subarray(0, xorbOffset),
198+
hash: chunkModule.compute_xorb_hash(xorbChunks),
199+
chunks: [...xorbChunks],
200+
id: xorbId,
201+
files: Object.entries(xorbFiles).map(([path, progress]) => ({ path, progress })),
202+
};
203+
}
193204
} finally {
194205
chunker.free();
195206
// ^ is this really needed ?

0 commit comments

Comments
 (0)