MCPcopy Create free account
hub / github.com/coder/mux / listRuns

Method listRuns

src/node/services/workflows/WorkflowRunStore.ts:262–286  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

260 }
261
262 async listRuns(): Promise<WorkflowRunRecord[]> {
263 let entries: Dirent[];
264 try {
265 entries = await fs.readdir(this.workflowsDir(), { withFileTypes: true });
266 } catch {
267 return [];
268 }
269
270 const runs = await Promise.all(
271 entries
272 .filter((entry) => entry.isDirectory())
273 .map(async (entry): Promise<WorkflowRunRecord | null> => {
274 try {
275 return await this.getRun(entry.name);
276 } catch (error) {
277 log.warn(`Skipping unreadable workflow run '${entry.name}': ${getErrorMessage(error)}`);
278 return null;
279 }
280 })
281 );
282
283 return runs
284 .filter((run): run is WorkflowRunRecord => run != null)
285 .sort((a, b) => a.createdAt.localeCompare(b.createdAt));
286 }
287
288 async appendNextEvent(
289 runId: string,

Calls 3

workflowsDirMethod · 0.95
getRunMethod · 0.95
getErrorMessageFunction · 0.90

Tested by

no test coverage detected