@@ -18,8 +18,6 @@ function resolveMaxExitedRecords(value?: number): number {
|
18 | 18 | export type RunRegistry = { |
19 | 19 | add: (record: RunRecord) => void; |
20 | 20 | get: (runId: string) => RunRecord | undefined; |
21 | | -list: () => RunRecord[]; |
22 | | -listByScope: (scopeKey: string) => RunRecord[]; |
23 | 21 | updateState: ( |
24 | 22 | runId: string, |
25 | 23 | state: RunState, |
@@ -34,7 +32,6 @@ export type RunRegistry = {
|
34 | 32 | exitSignal: NodeJS.Signals | number | null; |
35 | 33 | }, |
36 | 34 | ) => { record: RunRecord; firstFinalize: boolean } | null; |
37 | | -delete: (runId: string) => void; |
38 | 35 | }; |
39 | 36 | |
40 | 37 | /** |
@@ -81,19 +78,6 @@ export function createRunRegistry(options?: { maxExitedRecords?: number }): RunR
|
81 | 78 | return record ? { ...record } : undefined; |
82 | 79 | }; |
83 | 80 | |
84 | | -const list: RunRegistry["list"] = () => { |
85 | | -return Array.from(records.values()).map((record) => Object.assign({}, record)); |
86 | | -}; |
87 | | - |
88 | | -const listByScope: RunRegistry["listByScope"] = (scopeKey) => { |
89 | | -if (!scopeKey.trim()) { |
90 | | -return []; |
91 | | -} |
92 | | -return Array.from(records.values()) |
93 | | -.filter((record) => record.scopeKey === scopeKey) |
94 | | -.map((record) => Object.assign({}, record)); |
95 | | -}; |
96 | | - |
97 | 81 | const updateState: RunRegistry["updateState"] = (runId, state, patch) => { |
98 | 82 | const current = records.get(runId); |
99 | 83 | if (!current) { |
@@ -146,18 +130,11 @@ export function createRunRegistry(options?: { maxExitedRecords?: number }): RunR
|
146 | 130 | return { record: { ...next }, firstFinalize }; |
147 | 131 | }; |
148 | 132 | |
149 | | -const del: RunRegistry["delete"] = (runId) => { |
150 | | -records.delete(runId); |
151 | | -}; |
152 | | - |
153 | 133 | return { |
154 | 134 | add, |
155 | 135 | get, |
156 | | - list, |
157 | | - listByScope, |
158 | 136 | updateState, |
159 | 137 | touchOutput, |
160 | 138 | finalize, |
161 | | -delete: del, |
162 | 139 | }; |
163 | 140 | } |