Commit 1388cec
committed
fix(wait-for-hydra): add periodic re-checks during SSE stream
CDN proxies like Cloudflare may buffer SSE events, preventing real-time
delivery of status updates to the client. This caused the script to
hang indefinitely on the SSE stream even after the build completed.
Three fixes:
1. Periodic one-shot re-check: every 120s, poll the bridge's cached
/status endpoint directly. This catches status changes even when
SSE events are buffered or lost.
2. Reserve time for fallback: set curl --max-time to TIMEOUT - 120s
so there's always 2 minutes left for one-shot re-check + polling.
3. Final one-shot re-check after SSE stream ends, before entering
the polling fallback loop.1 parent afaa453 commit 1388cec
1 file changed
Lines changed: 38 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
118 | 134 | | |
119 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
120 | 156 | | |
121 | 157 | | |
122 | 158 | | |
| |||
146 | 182 | | |
147 | 183 | | |
148 | 184 | | |
149 | | - | |
| 185 | + | |
150 | 186 | | |
151 | 187 | | |
152 | 188 | | |
| |||
0 commit comments