mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-04 11:15:39 +00:00
refactor(app): route admin/object globals through AppContext (#1954)
This commit is contained in:
@@ -98,10 +98,7 @@ impl DefaultAdminUsecase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn endpoints(&self) -> Option<EndpointServerPools> {
|
fn endpoints(&self) -> Option<EndpointServerPools> {
|
||||||
self.context
|
self.context.as_ref().and_then(|context| context.endpoints().handle())
|
||||||
.as_ref()
|
|
||||||
.and_then(|context| context.endpoints().handle())
|
|
||||||
.or_else(|| rustfs_ecstore::GLOBAL_Endpoints.get().cloned())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn app_error(code: S3ErrorCode, message: impl Into<String>) -> ApiError {
|
fn app_error(code: S3ErrorCode, message: impl Into<String>) -> ApiError {
|
||||||
|
|||||||
@@ -201,10 +201,7 @@ impl DefaultObjectUsecase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn bucket_metadata_sys(&self) -> Option<Arc<RwLock<metadata_sys::BucketMetadataSys>>> {
|
fn bucket_metadata_sys(&self) -> Option<Arc<RwLock<metadata_sys::BucketMetadataSys>>> {
|
||||||
self.context
|
self.context.as_ref().and_then(|context| context.bucket_metadata().handle())
|
||||||
.as_ref()
|
|
||||||
.and_then(|context| context.bucket_metadata().handle())
|
|
||||||
.or_else(|| rustfs_ecstore::bucket::metadata_sys::GLOBAL_BucketMetadataSys.get().cloned())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[instrument(level = "debug", skip(self, fs, req))]
|
#[instrument(level = "debug", skip(self, fs, req))]
|
||||||
|
|||||||
Reference in New Issue
Block a user