Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: andylokandy <[email protected]>
  • Loading branch information
andylokandy committed Jun 22, 2024
1 parent 2b9438b commit 9a4a1df
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions minitrace/src/collector/global_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,9 @@ pub fn flush() {
std::thread::Builder::new()
.name("minitrace-flush".to_string())
.spawn(move || {
GLOBAL_COLLECTOR
.lock()
.as_mut()
.unwrap()
.handle_commands(true);
if let Some(global_collector) = GLOBAL_COLLECTOR.lock().as_mut() {
global_collector.handle_commands(true);
}
})
.unwrap()
.join()
Expand Down Expand Up @@ -234,9 +232,11 @@ impl GlobalCollector {
.spawn(move || {
loop {
let begin_instant = Instant::now();
if let Some(global_collector) = GLOBAL_COLLECTOR.lock().as_mut() {
global_collector.handle_commands(false);
}
GLOBAL_COLLECTOR
.lock()
.as_mut()
.unwrap()
.handle_commands(false);
std::thread::sleep(
config
.background_collect_interval
Expand Down

0 comments on commit 9a4a1df

Please sign in to comment.