Skip to content

Commit

Permalink
Fix logs polling (was polled only for finished queries, while should …
Browse files Browse the repository at this point in the history
…be opposite)
  • Loading branch information
azat committed Mar 30, 2024
1 parent 7198303 commit d646157
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/view/processes_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ impl ProcessesView {
if q.query_start_time_microseconds < min_query_start_microseconds {
min_query_start_microseconds = q.query_start_time_microseconds;
}
if self.is_system_processes {
if !self.is_system_processes {
let query_end_time_microseconds = q
.query_start_time_microseconds
.checked_add_signed(
Expand Down
20 changes: 10 additions & 10 deletions src/view/text_log_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ impl TextLogView {
if max_query_end_microseconds.is_some()
&& (now - max_query_end_microseconds.unwrap()) >= flush_interval_milliseconds
{
context
.lock()
.unwrap()
.worker
.send(WorkerEvent::GetQueryTextLog(
query_ids.clone(),
query_start_microseconds,
max_query_end_microseconds,
));
} else {
let update_query_ids = query_ids.clone();
let update_last_event_time_microseconds = last_event_time_microseconds.clone();
let update_callback_context = context.clone();
Expand All @@ -65,16 +75,6 @@ impl TextLogView {
let mut created_bg_runner = BackgroundRunner::new(delay, bg_runner_cv);
created_bg_runner.start(update_callback);
bg_runner = Some(created_bg_runner);
} else {
context
.lock()
.unwrap()
.worker
.send(WorkerEvent::GetQueryTextLog(
query_ids.clone(),
query_start_microseconds,
max_query_end_microseconds,
));
}

let is_cluster = context.lock().unwrap().options.clickhouse.cluster.is_some();
Expand Down

0 comments on commit d646157

Please sign in to comment.