perf: async R2 upload + Cloudflare Worker for native R2 binding
- wire_push_object_pack now returns 200 immediately after a single DB write (storage_uri='pending', content_cache=raw_bytes). R2 upload happens in a background asyncio task, eliminating EC2→R2 network latency from the client's critical path entirely (~875ms → ~5ms).
- Fetch path handles pending objects: _pack_objects_response serves content_cache when storage_uri=='pending', so pulls never block on the background upload task.
- Startup recovery in lifespan re-queues any objects left pending from a prior crash — content_cache bytes survive in Postgres.
- Alembic migration 0042 adds content_cache BYTEA (nullable) to musehub_objects.
- cloudflare/pack-receiver/worker.js: Cloudflare Worker that receives MWP packs, stores objects directly to R2 via native R2 binding (~1ms/PUT, no EC2 hop), then calls /internal/register-objects to register IDs in Postgres.
- /internal/register-objects route + WORKER_INTERNAL_KEY setting for the Worker→MuseHub callback leg.
107/107 wire protocol tests pass.
0 comments
muse hub commit comment sha256:38d96d4059b3ebc86e30f7fe0d6df03d245d82ebc3675453e5dbb6a481972b4a --body "your comment"
No comments yet. Be the first to start the discussion.