forge-runtime 0.9.0

Runtime executors and gateway for the Forge framework
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Materialized view refresh for signals dashboards.
//!
//! Refreshes views concurrently (non-blocking reads) every 5 minutes.

use sqlx::PgPool;
use tracing::{debug, error};

/// Refresh all signals materialized views concurrently.
pub async fn refresh_views(pool: &PgPool) {
    let result = sqlx::query("SELECT forge_signals_refresh_views()")
        .execute(pool)
        .await;

    match result {
        Ok(_) => debug!("refreshed signal materialized views"),
        Err(e) => error!(error = %e, "failed to refresh signal materialized views"),
    }
}