mirror of
https://github.com/morluto/rea.git
synced 2026-11-15 03:02:56 +00:00
refactor: remove legacy seams and consolidate resource ownership (#10349)
This commit is contained in:
1 parent
5cddc69c51
commit
bbe2bcc979
301 files changed
+3148
-2804
No files matched your search
@@ -25,7 +25,7 @@ export const BUILD_REA_TIMEOUT_S = 1800;
|
||||
* Linux `MAX_ARG_STRLEN` on a 4 KiB page, excluding the NUL the kernel counts.
|
||||
* One argument past this fails with E2BIG before the process starts.
|
||||
*/
|
||||
export const LINUX_SINGLE_ARGUMENT_BYTES = 32 * 4096 - 1;
|
||||
const LINUX_SINGLE_ARGUMENT_BYTES = 32 * 4096 - 1;
|
||||
/**
|
||||
* A usual Linux `ARG_MAX`, leaving room for the environment the kernel counts
|
||||
* with the arguments. A larger vector fails with E2BIG before the process starts.
|
||||
@@ -43,7 +43,7 @@ const isLowSurrogate = (text: string, index: number): boolean => {
|
||||
};
|
||||
|
||||
/** Pieces of `text` that each fit in one Linux argument and join back to it. */
|
||||
export const controllerArgumentPieces = (text: string): readonly string[] => {
|
||||
const controllerArgumentPieces = (text: string): readonly string[] => {
|
||||
const pieces: string[] = [];
|
||||
let start = 0;
|
||||
while (start < text.length) {
|
||||
@@ -277,7 +277,7 @@ const listFolder = async (
|
||||
};
|
||||
|
||||
/** One listed file and the answer budget a batch must fit. */
|
||||
export interface ListedBatchFile {
|
||||
interface ListedBatchFile {
|
||||
readonly path: string;
|
||||
readonly size: number;
|
||||
}
|
||||
@@ -287,7 +287,7 @@ export interface ListedBatchFile {
|
||||
* `rawBytes` or its base64 answer, including each file's envelope, passes
|
||||
* `answerBytes`.
|
||||
*/
|
||||
export const batchListedFiles = <File extends ListedBatchFile>(
|
||||
const batchListedFiles = <File extends ListedBatchFile>(
|
||||
files: readonly File[],
|
||||
limits: { readonly rawBytes: number; readonly answerBytes: number },
|
||||
): { files: File[]; bytes: number }[] => {
|
||||
|
||||
Reference in new issue
Block a user