Skip to main content

init

Function init 

Source
pub async fn init(
    database_url: &str,
) -> Result<DatabaseConnection, DurableError>
Expand description

Initialize durable: connect to Postgres, run migrations, start heartbeat, and recover stale tasks from prior crashes.

Uses HeartbeatConfig::default() (60 s heartbeat, 180 s staleness). For custom intervals use init_with_config.

let db = durable::init("postgres://localhost/mydb").await?;