/// Start a background task for time based settlement. If time based settlement is configured but
/// this task is never started, the time-based settlement does not happen and a warning is logged
/// every minute on eligble random peering account.
Start a background task for time based settlement. If time based settlement is configured but
this task is never started, the time-based settlement does not happen and a warning is logged
every minute on eligble random peering account.
Start a background task for time based settlement . If time based settlement is configured but this task is never started the time - based settlement does not happen and a warning is logged every minute on eligble random peering account .
pub fn start_delayed_settlement<St, Store, Acct>(
    delay: Duration,
    cmds: St,
    store: Store,
) -> tokio::task::JoinHandle<()>
where
    St: futures::stream::FusedStream<Item = ManageTimeout> + Send + Sync + 'static + Unpin,
    Store: BalanceStore
        + SettlementStore<Account = Acct>
        + AccountStore<Account = Acct>
        + Clone
        + Send
        + Sync
        + 'static,
    Acct: SettlementAccount + Send + Sync + 'static,
{
    let client = SettlementClient::default();
    tokio::spawn(async move {
        info!(
            "Starting to run delayed settlements with a timeout of {:?}",
            delay
        );
        let exit_reason = run_timeouts_and_settle_on_delay(delay, cmds, store, client).await;
        info!(
            "Stopped running timeouts and delayed settlements: {}",
            exit_reason
        );
    })
}
pub fn start_delayed_settlement < St , Store , Acct > ( delay : Duration , cmds : St , store : Store , ) -> tokio :: task :: JoinHandle < ( ) > where St : futures :: stream :: FusedStream < Item = ManageTimeout > + Send + Sync + ' static + Unpin , Store : BalanceStore + SettlementStore < Account = Acct > + AccountStore < Account = Acct > + Clone + Send + Sync + ' static , Acct : SettlementAccount + Send + Sync + ' static , { let client = SettlementClient :: default ( ) ; tokio :: spawn ( async move { info ! ( " " delay ) ; let exit_reason = run_timeouts_and_settle_on_delay ( delay , cmds , store , client ) . await ; info ! ( " " exit_reason ) ; } ) }
Start a background task for time based settlement.
Start a background task for time based settlement .
delay
Duration
cmds
St
store
Store