pub(crate) async fn initialize_server(
    config: Arc<Config>,
    wipe_on_error: bool,
    skip_replay_and_seek_instead: bool,
) -> Result<Vec<(DatabaseName<'static>, Result<()>)>> {
    let root = config.root_path();

    // get the database names from the object store prefixes
    // TODO: update object store to pull back all common prefixes by
    //       following the next tokens.
    let list_result = config
        .object_store()
        .list_with_delimiter(&root)
        .await
        .context(StoreError)?;

    let handles: Vec<_> = list_result
        .common_prefixes
        .into_iter()
        .filter_map(|mut path| {
            let config = Arc::clone(&config);
            let root = root.clone();
            path.set_file_name(DB_RULES_FILE_NAME);
            let db_name = db_name_from_rules_path(&path)
                .log_if_error("invalid database path")
                .ok()?;

            Some(async move {
                let result = initialize_database(
                    config,
                    root,
                    db_name.clone(),
                    wipe_on_error,
                    skip_replay_and_seek_instead,
                )
                .await;
                (db_name, result)
            })
        })
        .collect();

    Ok(futures::future::join_all(handles).await)
}
/// Loads the database configurations based on the databases in the
/// object store. Any databases in the config already won't be
/// replaced.
///
/// Returns a Vec containing the results of loading the contained databases
Loads the database configurations based on the databases in the
object store. Any databases in the config already won't be
replaced.

Returns a Vec containing the results of loading the contained databases
Loads the database configurations based on the databases in the object store . Any databases in the config already won ' t be replaced . Returns a Vec containing the results of loading the contained databases
pub(crate) async fn initialize_server(
    config: Arc<Config>,
    wipe_on_error: bool,
    skip_replay_and_seek_instead: bool,
) -> Result<Vec<(DatabaseName<'static>, Result<()>)>> {
    let root = config.root_path();
    // get the database names from the object store prefixes
    // TODO: update object store to pull back all common prefixes by
    //       following the next tokens.
    let list_result = config
        .object_store()
        .list_with_delimiter(&root)
        .await
        .context(StoreError)?;
    let handles: Vec<_> = list_result
        .common_prefixes
        .into_iter()
        .filter_map(|mut path| {
            let config = Arc::clone(&config);
            let root = root.clone();
            path.set_file_name(DB_RULES_FILE_NAME);
            let db_name = db_name_from_rules_path(&path)
                .log_if_error("invalid database path")
                .ok()?;
            Some(async move {
                let result = initialize_database(
                    config,
                    root,
                    db_name.clone(),
                    wipe_on_error,
                    skip_replay_and_seek_instead,
                )
                .await;
                (db_name, result)
            })
        })
        .collect();
    Ok(futures::future::join_all(handles).await)
}
pub ( crate ) async fn initialize_server ( config : Arc < Config > , wipe_on_error : bool , skip_replay_and_seek_instead : bool , ) -> Result < Vec < ( DatabaseName < ' static > , Result < ( ) > ) > > { let root = config . root_path ( ) ; // get the database names from the object store prefixes // TODO: update object store to pull back all common prefixes by //       following the next tokens. let list_result = config . object_store ( ) . list_with_delimiter ( & root ) . await . context ( StoreError ) ? ; let handles : Vec < _ > = list_result . common_prefixes . into_iter ( ) . filter_map ( | mut path | { let config = Arc :: clone ( & config ) ; let root = root . clone ( ) ; path . set_file_name ( DB_RULES_FILE_NAME ) ; let db_name = db_name_from_rules_path ( & path ) . log_if_error ( " " ) . ok ( ) ? ; Some ( async move { let result = initialize_database ( config , root , db_name . clone ( ) , wipe_on_error , skip_replay_and_seek_instead , ) . await ; ( db_name , result ) } ) } ) . collect ( ) ; Ok ( futures :: future :: join_all ( handles ) . await ) }
Loads the database configurations based on the databases in the
object store.
Loads the database configurations based on the databases in the object store .
config
Arc<Config>
wipe_on_error
bool
skip_replay_and_seek_instead
bool
config
Arc<Config>
wipe_on_error
bool
skip_replay_and_seek_instead
bool