docs: correct get_pool singleton pattern in CLAUDE.md #83

Merged
gertjan merged 1 commit from docs/claudemd-get-pool-singleton into main 2026-07-12 17:10:27 +00:00
Owner

CLAUDE.md's "Key singletons" section claimed both get_db_client() and get_pool() use @lru_cache. That's only true for get_db_client() (src/database/client.py:44).

get_pool() (src/database/timescale_client.py:147) is a module-global _pool guarded by an asyncio.Lock — the correct pattern for an async factory, since lru_cache would memoize the returned coroutine rather than the pool.

Docs-only change; corrects a claim a future session could reason wrongly from.

🤖 Generated with Claude Code

CLAUDE.md's "Key singletons" section claimed **both** `get_db_client()` and `get_pool()` use `@lru_cache`. That's only true for `get_db_client()` (src/database/client.py:44). `get_pool()` (src/database/timescale_client.py:147) is a module-global `_pool` guarded by an `asyncio.Lock` — the correct pattern for an async factory, since `lru_cache` would memoize the returned coroutine rather than the pool. Docs-only change; corrects a claim a future session could reason wrongly from. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
docs: correct get_pool singleton pattern in CLAUDE.md
All checks were successful
Deploy / check (pull_request) Successful in 4m11s
Deploy / deploy (pull_request) Has been skipped
a42b2a5e55
get_pool() is not @lru_cache — it's a module-global guarded by an
asyncio.Lock (an async factory can't use lru_cache, which would cache
the coroutine rather than the pool). Only get_db_client() is @lru_cache.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gertjan deleted branch docs/claudemd-get-pool-singleton 2026-07-12 17:10:27 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
gertjan/bodega!83
No description provided.