[hotfix] Reuse database client in data explorer queries
@@ -101,13 +101,20 @@ public class DataExplorerQueryV4 {
public SpQueryResult executeQuery(Query query, boolean ignoreMissingValues) {
InfluxDB influxDB = DataExplorerUtils.getInfluxDBClient();
- QueryResult result = influxDB.query(query);
- SpQueryResult dataResult = postQuery(result, ignoreMissingValues);
+ var dataResult = executeQuery(influxDB, query, ignoreMissingValues);
influxDB.close();
return dataResult;
}
+ public SpQueryResult executeQuery(InfluxDB influxDB,
+ Query query,
+ boolean ignoreMissingValues) {
+ QueryResult result = influxDB.query(query);
+
+ return postQuery(result, ignoreMissingValues);
+ }
+
private double getAmountOfResults(QueryResult countQueryResult) {
if (countQueryResult.getResults().get(0).getSeries() != null
&& countQueryResult.getResults().get(0).getSeries().get(0).getValues() != null) {
