mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-23 11:29:54 +00:00
* wip: partial security fix, paused before tests finished * fix(cli): a received-files record in a folder under the project counts for a render The received-files lookup now also walks the project's folders for records, skipping tool and output folders and never following links. A nested record's entries are received files named from the project folder, so a received scene copied in with its own record makes the render leave out outside files, as a record at or above the project does. A walk that cannot list every folder fails closed.
13 lines
415 B
TypeScript
13 lines
415 B
TypeScript
const WALK_MAX_ENTRIES = 20_000;
|
|
const WALK_MAX_MS = 2_000;
|
|
|
|
/** Counts what a project walk lists; false once it passes the entry or time limit, so the walk stops unfinished. */
|
|
export function walkBudget(): (entries: number) => boolean {
|
|
const deadline = Date.now() + WALK_MAX_MS;
|
|
let seen = 0;
|
|
return (entries) => {
|
|
seen += entries;
|
|
return seen <= WALK_MAX_ENTRIES && Date.now() <= deadline;
|
|
};
|
|
}
|