Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Cost hotfix: make boot database sync opt-in
Browse filesOwner instruction: implement and deploy the Neon cost fix. Separate finite cache prewarm from multi-minute Odoo/database boot sync so Live can restart without a resident bootstrap writer.
- api/main.py +5 -2
api/main.py
CHANGED
|
@@ -1088,8 +1088,11 @@ def _prewarm():
|
|
| 1088 |
# showed the pool warm (42s) silently queued behind it — the whole app cold for every
|
| 1089 |
# visitor while a background column channel caught up. Measure cells retry via the
|
| 1090 |
# transient rule until the sync lands; nothing else waits on it.
|
| 1091 |
-
|
| 1092 |
-
|
|
|
|
|
|
|
|
|
|
| 1093 |
try:
|
| 1094 |
from harness import runtime as _runtime
|
| 1095 |
rt = _runtime.get_runtime("royal-imports")
|
|
|
|
| 1088 |
# showed the pool warm (42s) silently queued behind it — the whole app cold for every
|
| 1089 |
# visitor while a background column channel caught up. Measure cells retry via the
|
| 1090 |
# transient rule until the sync lands; nothing else waits on it.
|
| 1091 |
+
# Odoo seed/sync is separate from the finite cache warm below. Live Pg keeps this opt-in
|
| 1092 |
+
# so a routine restart does not create a multi-minute database/Odoo background job.
|
| 1093 |
+
if os.environ.get("AIOS_BOOT_SYNC") == "1":
|
| 1094 |
+
import threading as _th
|
| 1095 |
+
_th.Thread(target=_seed_and_sync_store, daemon=True, name="store-seed-sync").start()
|
| 1096 |
try:
|
| 1097 |
from harness import runtime as _runtime
|
| 1098 |
rt = _runtime.get_runtime("royal-imports")
|