refactor(app): remove remaining global access in main init (#1978)

This commit is contained in:
安正超
2026-02-26 22:14:51 +08:00
committed by GitHub
parent a3c76618f3
commit 09aa6d9f6f
3 changed files with 14 additions and 7 deletions
@@ -977,6 +977,10 @@ pub async fn init_background_replication<S: StorageAPI>(storage: Arc<S>) {
assert!(GLOBAL_REPLICATION_POOL.get().is_some());
}
pub fn get_global_replication_pool() -> Option<Arc<DynReplicationPool>> {
GLOBAL_REPLICATION_POOL.get().cloned()
}
pub async fn schedule_replication<S: StorageAPI>(oi: ObjectInfo, o: Arc<S>, dsc: ReplicateDecision, op_type: ReplicationType) {
let tgt_statuses = replication_statuses_map(&oi.replication_status_internal.clone().unwrap_or_default());
let purge_statuses = version_purge_statuses_map(&oi.version_purge_status_internal.clone().unwrap_or_default());
+4
View File
@@ -71,6 +71,10 @@ pub fn get_global_server_config() -> Option<Config> {
GLOBAL_SERVER_CONFIG.get().cloned()
}
pub async fn init_global_config_sys(api: Arc<ECStore>) -> Result<()> {
GLOBAL_CONFIG_SYS.init(api).await
}
#[derive(Debug, Deserialize, Serialize, Clone)]
pub struct KV {
pub key: String,