Skip to content

Commit

Permalink
only check runtime config if async_inserts cli arg true
Browse files Browse the repository at this point in the history
  • Loading branch information
MeredithAnya committed May 23, 2024
1 parent c02038b commit 98cfa8e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rust_snuba/src/strategies/clickhouse/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ impl BatchFactory {
let mut query_params = String::new();
query_params.push_str("load_balancing=in_order&insert_distributed_sync=1");

let async_inserts_allowed = get_str_config("async_inserts_allowed").ok().flatten();
if async_inserts && async_inserts_allowed == Some(1.to_string()) {
query_params.push_str("&async_insert=1&wait_for_async_insert=1");
if async_inserts {
let async_inserts_allowed = get_str_config("async_inserts_allowed").ok().flatten();
if async_inserts_allowed == Some("1".to_string()) {
query_params.push_str("&async_insert=1&wait_for_async_insert=1");
}
}

let url = format!("http://{hostname}:{http_port}?{query_params}");
Expand Down

0 comments on commit 98cfa8e

Please sign in to comment.