Commit eefcfcf
fix(service-cloud): plumb startupTimeout through lazyPlugin wrapper, externalize pg
While verifying the new out-of-band migration path against Neon, three
real bugs surfaced that explained why the prior cf-cold-start fixes
weren't enough:
1. lazyPlugin() wrapper drops startupTimeout
The control-plane preset wraps every plugin in a lazyPlugin proxy
so heavy deps load on init() instead of parse-time. The wrapper
exposed only { name, init, start, stop } — the kernel reads
plugin.startupTimeout at start time, so even after we set
ObjectQLPlugin.startupTimeout = 120_000, the wrapper's missing
property caused the kernel to fall back to its 30s default. Add an
opt-in startupTimeout argument to lazyPlugin() and pass it through
for ObjectQL (120s in production, 600s in OS_MIGRATE_AND_EXIT mode
for latency-disadvantaged operators migrating across regions).
2. service-cloud bundles pg
tsup was compiling the dynamic import('pg') into a CJS chunk that
failed at runtime with 'Dynamic require of "events" is not
supported'. Mark pg / pg-native / pg-cloudflare as external so they
resolve from node_modules at runtime.
3. service-cloud doesn't declare pg
pnpm strict isolation means apps/cloud declaring pg doesn't make it
resolvable from packages/services/service-cloud/dist/index.js. Add
pg as an optionalDependency on service-cloud so pnpm symlinks it
into the package's own node_modules.
Verified: pnpm --filter @objectstack/cloud migrate now runs schema
sync against Neon end-to-end and exits 0 (4m26s first run, 3m53s
idempotent second run).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent a7cc292 commit eefcfcf
4 files changed
Lines changed: 42 additions & 3 deletions
File tree
- packages/services/service-cloud
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
Lines changed: 27 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
33 | 44 | | |
34 | | - | |
| 45 | + | |
35 | 46 | | |
36 | 47 | | |
37 | 48 | | |
| |||
44 | 55 | | |
45 | 56 | | |
46 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
47 | 62 | | |
48 | 63 | | |
49 | 64 | | |
| |||
67 | 82 | | |
68 | 83 | | |
69 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
70 | 91 | | |
71 | 92 | | |
72 | 93 | | |
73 | 94 | | |
74 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
75 | 99 | | |
76 | 100 | | |
77 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments