pub async fn process_updates_since_last_ati(tx: Sender<Message>) {
    let mut cm = redis_cm().await.clone();
    let index_id: Option<i64> = cm.get("ati:latest").await.unwrap();

    if let Some(index_id) = index_id {
        info!("Last account transaction index ID {}", index_id);
        let updates = db::account_updates_since(index_id).await.unwrap();

        if updates.len() > 0 {
            info!("Processing {} account updates", updates.len());
            for (index_id, address, summary) in updates {
                match serde_json::from_str(&summary) {
                    Ok(summary) => {
                        let update = AccountUpdate {
                            index_id,
                            account: AccountAddress::new(address),
                            summary,
                        };
                        handle_update(&tx, update, &mut cm).await;
                    }
                    Err(err) => {
                        error!("{}", err);
                        debug!("index_id: {} summary: {}", index_id, summary);
                    }
                }
            }
        } else {
            info!("No account updates found");
        }
    } else {
        info!("Last account transaction index ID not found");
    }
}
/// Processes account updates since last handled account transaction index.
Processes account updates since last handled account transaction index.
Processes account updates since last handled account transaction index .
pub async fn process_updates_since_last_ati(tx: Sender<Message>) {
    let mut cm = redis_cm().await.clone();
    let index_id: Option<i64> = cm.get("ati:latest").await.unwrap();
    if let Some(index_id) = index_id {
        info!("Last account transaction index ID {}", index_id);
        let updates = db::account_updates_since(index_id).await.unwrap();
        if updates.len() > 0 {
            info!("Processing {} account updates", updates.len());
            for (index_id, address, summary) in updates {
                match serde_json::from_str(&summary) {
                    Ok(summary) => {
                        let update = AccountUpdate {
                            index_id,
                            account: AccountAddress::new(address),
                            summary,
                        };
                        handle_update(&tx, update, &mut cm).await;
                    }
                    Err(err) => {
                        error!("{}", err);
                        debug!("index_id: {} summary: {}", index_id, summary);
                    }
                }
            }
        } else {
            info!("No account updates found");
        }
    } else {
        info!("Last account transaction index ID not found");
    }
}
pub async fn process_updates_since_last_ati ( tx : Sender < Message > ) { let mut cm = redis_cm ( ) . await . clone ( ) ; let index_id : Option < i64 > = cm . get ( " " ) . await . unwrap ( ) ; if let Some ( index_id ) = index_id { info ! ( " " index_id ) ; let updates = db :: account_updates_since ( index_id ) . await . unwrap ( ) ; if updates . len ( ) > 0 { info ! ( " " updates len ( ) ) ; for ( index_id , address , summary ) in updates { match serde_json :: from_str ( & summary ) { Ok ( summary ) => { let update = AccountUpdate { index_id , account : AccountAddress :: new ( address ) , summary , } ; handle_update ( & tx , update , & mut cm ) . await ; } Err ( err ) => { error ! ( " " err ) ; debug ! ( " " index_id summary ) ; } } } } else { info ! ( " " ) ; } } else { info ! ( " " ) ; } }
Processes account updates since last handled account transaction index.
Processes account updates since last handled account transaction index .
tx
Sender<Message>
tx
Sender<Message>