diff --git a/rustfs/src/main.rs b/rustfs/src/main.rs index fbc946cb..2ab33bc0 100644 --- a/rustfs/src/main.rs +++ b/rustfs/src/main.rs @@ -243,8 +243,18 @@ async fn run(opt: config::Opt) -> Result<()> { })?; ecconfig::init(); - // config system configuration - GLOBAL_CONFIG_SYS.init(store.clone()).await?; + // config system configuration, wait for 1 second if failed + let mut retry_count = 0; + + while let Err(e) = GLOBAL_CONFIG_SYS.init(store.clone()).await { + error!("GLOBAL_CONFIG_SYS.init failed {:?}", e); + // TODO: check error type + retry_count += 1; + if retry_count > 15 { + return Err(Error::other("GLOBAL_CONFIG_SYS.init failed")); + } + tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; + } // init replication_pool init_background_replication(store.clone()).await;