Skip to main content

dedicated_key_store_pool

Function dedicated_key_store_pool 

Source
pub fn dedicated_key_store_pool(lake_pool: &Pool<Postgres>) -> Pool<Postgres>
Expand description

Builds a small, dedicated connection pool for key-store lookups from an existing pool’s options — rather than sharing the caller’s lake pool directly. Inherits the lake pool’s options wholesale (including any after_connect/before_acquire hooks, e.g. the read-only-connection checks in micromegas_ingestion::data_lake_connection), not just its connect options, so a strict or prefer-fallback lake pool’s write-session guarantee carries over to the key store. max_connections(4), acquire_timeout(2s): a credential flood or a DB outage on the key-lookup path can therefore never starve the write path of connections, and a lookup fails fast into its 503 rather than blocking up to sqlx’s default 30s acquire_timeout.