Repository navigation
Commit c1cd267
function_storage: support :memory: backend, default it for fixture HTTP server
FunctionStorageSqlite opens a fresh sqlite3 connection per operation and
commits at the end, which on macOS APFS pays a per-call WAL fsync (~5ms
each). The test fixture HTTP server is single-process and ephemeral —
its hot path was burning seconds on fsyncs that no run will ever read
back.
- FunctionStorageSqlite(':memory:') now uses a shared-cache URI
(file:vgi_storage_<uuid>?mode=memory&cache=shared) with a long-lived
anchor connection so the per-op transient connections see the same
database. MEMORY journal mode applies implicitly — no fsync.
- _resolve_storage in function.py honours VGI_WORKER_SQLITE_PATH; the
test fixture HTTP server (vgi-fixture-http) sets it to ':memory:'
before any Function.storage access.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 393527f commit c1cd267
3 files changed
Lines changed: 42 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
118 | 125 | | |
119 | 126 | | |
120 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
431 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
432 | 437 | | |
433 | 438 | | |
434 | | - | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
435 | 459 | | |
436 | 460 | | |
437 | 461 | | |
438 | 462 | | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
439 | 467 | | |
440 | 468 | | |
441 | 469 | | |
| |||
0 commit comments