Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+9
-2
@@ -4,7 +4,7 @@
|
||||
// files are silently dropped, never leaked). Gated: auth -> module -> files.read_own.
|
||||
|
||||
import type { ActionFunctionArgs } from "react-router";
|
||||
import { zipSync } from "fflate";
|
||||
import { zip } from "fflate";
|
||||
import { badRequestResponse, fileActionErrorResponse, loadFilesContext, requireFilesPermission } from "~/utils/integrations/fileAccess.server";
|
||||
import { collectFilesForZip } from "~/utils/integrations/fileService.server";
|
||||
|
||||
@@ -33,7 +33,14 @@ export const action = async ({ request, params }: ActionFunctionArgs) => {
|
||||
for (const entry of entries) {
|
||||
zipInput[entry.name] = entry.bytes;
|
||||
}
|
||||
const zipped = zipSync(zipInput);
|
||||
// The async API moves compression work off the request event loop. At the
|
||||
// 200 MB upper bound, synchronous deflate would stall unrelated requests.
|
||||
const zipped = await new Promise<Uint8Array>((resolve, reject) => {
|
||||
zip(zipInput, (error, data) => {
|
||||
if (error) reject(error);
|
||||
else resolve(data);
|
||||
});
|
||||
});
|
||||
|
||||
// Hand the Response a plain ArrayBuffer (a typed BodyInit) — the fflate
|
||||
// Uint8Array<ArrayBufferLike> is accepted at runtime but not by the type.
|
||||
|
||||
Reference in new issue
Block a user