11use std:: sync:: Arc ;
2- use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
2+ use std:: sync:: atomic:: { AtomicBool , AtomicUsize , Ordering } ;
33use std:: time:: Duration ;
44
55use collection:: operations:: types:: CollectionResult ;
@@ -9,7 +9,6 @@ use collection::telemetry::{
99use common:: scope_tracker:: { ScopeTracker , ScopeTrackerGuard } ;
1010use common:: types:: TelemetryDetail ;
1111use dashmap:: DashMap ;
12- use shard:: common:: stopping_guard:: StoppingGuard ;
1312
1413use crate :: content_manager:: toc:: TableOfContent ;
1514use crate :: rbac:: Access ;
@@ -45,12 +44,12 @@ impl TableOfContent {
4544 detail : TelemetryDetail ,
4645 access : & Access ,
4746 timeout : Duration ,
48- is_stopped_guard : & StoppingGuard ,
47+ is_stopped : & AtomicBool ,
4948 ) -> CollectionResult < TocTelemetryData > {
5049 let all_collections = self . all_collections_access ( access) . await ;
5150 let mut collection_telemetry = Vec :: new ( ) ;
5251 for collection_pass in & all_collections {
53- if is_stopped_guard . is_stopped ( ) {
52+ if is_stopped. load ( Ordering :: Relaxed ) {
5453 break ;
5554 }
5655 if let Ok ( collection) = self . get_collection ( collection_pass) . await {
@@ -87,12 +86,12 @@ impl TableOfContent {
8786 & self ,
8887 access : & Access ,
8988 timeout : Duration ,
90- is_stopped_guard : & StoppingGuard ,
89+ is_stopped : & AtomicBool ,
9190 ) -> CollectionResult < Vec < CollectionsAggregatedTelemetry > > {
9291 let mut result = Vec :: new ( ) ;
9392 let all_collections = self . all_collections_access ( access) . await ;
9493 for collection_pass in & all_collections {
95- if is_stopped_guard . is_stopped ( ) {
94+ if is_stopped. load ( Ordering :: Relaxed ) {
9695 break ;
9796 }
9897 if let Ok ( collection) = self . get_collection ( collection_pass) . await {
0 commit comments