* Signal that the .mux/init hook is starting. * This marks the transition from runtime provisioning to hook execution so * waitForInit() can start the 5-minute timeout at the right time.
(workspaceId: string)
| 221 | * waitForInit() can start the 5-minute timeout at the right time. |
| 222 | */ |
| 223 | enterHookPhase(workspaceId: string): void { |
| 224 | const state = this.store.getState(workspaceId); |
| 225 | if (state?.status !== "running") { |
| 226 | return; |
| 227 | } |
| 228 | |
| 229 | if ((state.phase ?? "runtime_setup") === "init_hook") { |
| 230 | return; |
| 231 | } |
| 232 | |
| 233 | state.phase = "init_hook"; |
| 234 | state.hookStartTime = Date.now(); |
| 235 | |
| 236 | const promiseEntry = this.initPromises.get(workspaceId); |
| 237 | promiseEntry?.resolveHookPhase(); |
| 238 | } |
| 239 | |
| 240 | /** |
| 241 | * Append output line from init hook. |