Skip to main content

load

Function load 

Source
pub async fn load(pool: &PgPool, team_id: Uuid) -> Result<Snapshot, Error>
Expand description

Read everything the page shows for team_id.

Direct messages are excluded here, at the source, rather than being filtered later: the rendering layer never receives one, so it cannot leak one by accident.

The seven queries are independent, so they run concurrently on separate pool connections rather than one after another — the page refreshes every 15 seconds, and serialising them made the refresh as slow as their sum. Each sees its own snapshot, which is correct for a dashboard: the numbers are already stale by the time they reach a browser, and no derived value is computed across two of them.