pub async fn state_counts( pool: &PgPool, ) -> Result<HashMap<JobState, i64>, AwaError>
Count jobs grouped by state.
Reads from the queue_state_counts cache table.
queue_state_counts