also looking at this
fix: use release-local Bun for scheduled work
#43
4 files
+26
-5
| @@ -134,6 +134,26 @@ the same runtime. This does not upgrade the shared server's | ||
| 134 | 134 | Bun or Pantry binaries. A runtime installation or version-check failure stops |
| 135 | 135 | startup. |
| 136 | 136 | |
| 137 | ### Scheduled work | |
| 138 | ||
| 139 | The main site explicitly owns the single scheduler for `app/Scheduler.ts`. | |
| 140 | The API does not start another copy. Native ts-cloud 0.16.70 runs this scheduler | |
| 141 | with `backgroundBun: 'pantry/.bin/bun'`, using the physical release directory | |
| 142 | for its executable, working directory and child-command `PATH`. | |
| 143 | ||
| 144 | The native deployment stops background work before replacing an existing | |
| 145 | release directory. After activation it reconciles the services before pruning | |
| 146 | old releases, so a running task retains its admitted runtime and assets until | |
| 147 | it stops. A refused stop fails deployment rather than removing those assets. | |
| 148 | The runtime entry validates executable identity and containment before loading | |
| 149 | application work. A same-ID replacement that fails after draining may require | |
| 150 | a recovery deploy to restart background work. | |
| 151 | ||
| 152 | The app consumes the maintained public package through its normal dependency | |
| 153 | lockfile. It does not override ts-cloud with an older release or rewrite | |
| 154 | installed packages or host units. This scheduler creates planning records; | |
| 155 | it does not dispatch aircraft or mark a physical mission complete. | |
| 156 | ||
| 137 | 157 | ## preStart |
| 138 | 158 | |
| 139 | 159 | `catalog:sync` publishes content from `app/Support/content/` on every deploy. |