mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-25 03:45:46 -06:00
perf(test): cache parsed release workflows (#126673)
This commit is contained in:
committed by
GitHub
parent
e1051ceea3
commit
0d43ade926
@@ -192,8 +192,16 @@ type Workflow = {
|
||||
};
|
||||
};
|
||||
|
||||
const parsedWorkflows = new Map<string, Workflow>();
|
||||
|
||||
function readWorkflow(path: string): Workflow {
|
||||
return parse(readFileSync(path, "utf8")) as Workflow;
|
||||
const cachedWorkflow = parsedWorkflows.get(path);
|
||||
if (cachedWorkflow) {
|
||||
return cachedWorkflow;
|
||||
}
|
||||
const workflow = parse(readFileSync(path, "utf8")) as Workflow;
|
||||
parsedWorkflows.set(path, workflow);
|
||||
return workflow;
|
||||
}
|
||||
|
||||
function workflowPaths(): string[] {
|
||||
|
||||
Reference in New Issue
Block a user