Commit 781c615
committed
Run reload in a background thread to keep the server responsive
On large Rails apps (e.g., Bourgeois), reload takes 10-20 seconds.
During that time, the server can't process any other requests (model
info, route info, associations), causing the editor to freeze.
Run reload in a background thread and respond immediately. If another
reload arrives while one is in progress, mark that a follow-up reload
is needed. When the current reload finishes, it checks the flag and
reloads once more to pick up changes that arrived mid-reload. This
means N rapid reloads result in at most 2 actual reloads.
Related: Shopify/team-ruby-dx#17341 parent ca012cd commit 781c615
1 file changed
Lines changed: 19 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
332 | 342 | | |
333 | 343 | | |
334 | 344 | | |
| |||
0 commit comments