(rec, log, opts)
| 64 | |
| 65 | /** Re-scan the repo and push the fresh snapshot to connected clients. */ |
| 66 | export async function pushState(rec, log, opts) { |
| 67 | let state; |
| 68 | try { |
| 69 | state = await buildState(rec, opts); |
| 70 | } catch (e) { |
| 71 | if (log) log("appmod-cockpit scan failed: " + e.message, { level: "error" }); |
| 72 | return null; |
| 73 | } |
| 74 | broadcast(rec, { type: "state", state }); |
| 75 | return state; |
| 76 | } |
| 77 | |
| 78 | /** Clamp a requested step budget into a sane range. */ |
| 79 | function clampSteps(n) { |
no test coverage detected