Skip to content

Commit

Permalink
Remove magic const in rendering system.text_log (it is flush_interval…
Browse files Browse the repository at this point in the history
…_milliseconds)
  • Loading branch information
azat committed Oct 23, 2023
1 parent 8fb853b commit 2277982
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/view/text_log_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,17 @@ pub struct TextLogView {
bg_runner: BackgroundRunner,
}

// flush_interval_milliseconds for each *_log table from the config.xml/yml
const FLUSH_INTERVAL_MILLISECONDS: i64 = 7500;

impl TextLogView {
pub fn new(
context: ContextArc,
min_query_start_microseconds: DateTime64,
query_ids: Vec<String>,
) -> Self {
// subtract one second since we have a common expression for the query start time and the
// last available log and it is strict comparison
//
// NOTE: 1 second is not enough
let min_query_start_microseconds = min_query_start_microseconds
.checked_sub_signed(Duration::seconds(10))
.checked_sub_signed(Duration::milliseconds(FLUSH_INTERVAL_MILLISECONDS))
.unwrap();
let last_event_time_microseconds = Arc::new(Mutex::new(min_query_start_microseconds));

Expand Down

0 comments on commit 2277982

Please sign in to comment.