mirror of
https://github.com/zaphar/Heracles.git
synced 2025-07-24 13:09:47 -04:00
fix: Improper comma handling
This commit is contained in:
parent
f227a0058c
commit
a2cfaff490
@ -90,26 +90,28 @@ impl<'conn> PromQueryConn<'conn> {
|
|||||||
filter_string.push('"');
|
filter_string.push('"');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let mut query = self.query.to_string();
|
||||||
if self.query.contains(FILTER_PLACEHOLDER_COMMA) {
|
if self.query.contains(FILTER_PLACEHOLDER_COMMA) {
|
||||||
debug!("Replacing Filter comma placeholder");
|
debug!("Replacing Filter comma placeholder");
|
||||||
if !filter_string.is_empty() {
|
if !filter_string.is_empty() {
|
||||||
filter_string.push(',');
|
filter_string.push(',');
|
||||||
}
|
}
|
||||||
self.query.replace(FILTER_PLACEHOLDER, &filter_string)
|
query = query.replace(FILTER_PLACEHOLDER_COMMA, &filter_string);
|
||||||
} else if self.query.contains(FILTER_COMMA_PLACEHOLDER) {
|
}
|
||||||
|
if query.contains(FILTER_COMMA_PLACEHOLDER) {
|
||||||
debug!("Replacing Filter comma placeholder");
|
debug!("Replacing Filter comma placeholder");
|
||||||
if !filter_string.is_empty() {
|
if !filter_string.is_empty() {
|
||||||
let mut temp: String = ",".into();
|
let mut temp: String = ",".into();
|
||||||
temp.push_str(&filter_string);
|
temp.push_str(&filter_string);
|
||||||
filter_string = temp;
|
filter_string = temp;
|
||||||
}
|
}
|
||||||
self.query.replace(FILTER_PLACEHOLDER, &filter_string)
|
query = query.replace(FILTER_COMMA_PLACEHOLDER, &filter_string);
|
||||||
} else if self.query.contains(FILTER_PLACEHOLDER) {
|
|
||||||
debug!("Replacing Filter placeholder");
|
|
||||||
self.query.replace(FILTER_PLACEHOLDER, &filter_string)
|
|
||||||
} else {
|
|
||||||
self.query.to_string()
|
|
||||||
}
|
}
|
||||||
|
if query.contains(FILTER_PLACEHOLDER) {
|
||||||
|
debug!("Replacing Filter placeholder");
|
||||||
|
query = query.replace(FILTER_PLACEHOLDER, &filter_string)
|
||||||
|
}
|
||||||
|
query
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_results(&self) -> anyhow::Result<PromqlResult> {
|
pub async fn get_results(&self) -> anyhow::Result<PromqlResult> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user