MCPcopy Create free account
hub / github.com/cloudflare/templates / worker

Function worker

cli/src/deployLiveDemos.ts:66–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64 // Deploy every template even if one fails, so a single broken demo
65 // doesn't leave the rest stale.
66 async function worker() {
67 for (let template = queue.shift(); template; template = queue.shift()) {
68 const log: string[] = [];
69 try {
70 for (const [file, args] of STEPS) {
71 await runCommand(file, args, template.path, log);
72 }
73 } catch {
74 failed.push(template.name);
75 }
76 printLog(template.name, log);
77 }
78 }
79
80 await Promise.all(
81 Array.from({ length: Math.min(concurrency, templates.length) }, worker),

Callers

nothing calls this directly

Calls 2

runCommandFunction · 0.85
printLogFunction · 0.85

Tested by

no test coverage detected