Morning improvements

This commit is contained in:
Andras Schmelczer 2026-03-17 13:29:03 +00:00
parent 3e9fba5303
commit 53fff3efaa
41 changed files with 2438 additions and 637 deletions

View file

@ -763,11 +763,12 @@ pub async fn ensure_oauth_providers(
/// Spawn a background task that polls PocketBase every 60 seconds for collection counts
/// and exposes them as Prometheus gauges.
pub fn start_metrics_poller(state: Arc<AppState>) {
pub fn start_metrics_poller(shared: Arc<crate::state::SharedState>) {
tokio::spawn(async move {
let mut interval = tokio::time::interval(Duration::from_secs(60));
loop {
interval.tick().await;
let state = shared.load_state();
poll_pocketbase_counts(&state).await;
}
});
@ -815,7 +816,7 @@ async fn poll_pocketbase_counts(state: &AppState) {
("type", "referral"),
),
(
Some(r##"used_by_id!=""##),
Some(r#"used_by_id!="""#),
"invites_total",
("type", "redeemed"),
),