fix(ecstore): tolerate OnceLock re-initialization in tests (#4074)

This commit is contained in:
Zhengchao An
2026-06-30 00:18:28 +08:00
committed by GitHub
parent c17df6e3d3
commit f401a4388e
2 changed files with 19 additions and 5 deletions
+3 -1
View File
@@ -208,7 +208,9 @@ pub fn resolve_object_store_handle() -> Option<Arc<ECStore>> {
/// # Returns
/// * None
pub async fn set_object_layer(o: Arc<ECStore>) {
GLOBAL_OBJECT_API.set(o).expect("set_object_layer fail ")
if GLOBAL_OBJECT_API.set(o).is_err() {
warn!("global object layer already initialized, ignoring re-initialization");
}
}
/// Check if the setup type is distributed erasure coding