mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
bugfix: fix proper type of setting maxConcurrentShardRequests (#47120)
This commit is contained in:
parent
2478785aaf
commit
c0104db72d
@ -5,6 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"github.com/Masterminds/semver"
|
"github.com/Masterminds/semver"
|
||||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||||
@ -95,8 +96,17 @@ func newInstanceSettings() datasource.InstanceFactoryFunc {
|
|||||||
timeInterval = ""
|
timeInterval = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
maxConcurrentShardRequests, ok := jsonData["maxConcurrentShardRequests"].(float64)
|
var maxConcurrentShardRequests float64
|
||||||
if !ok {
|
|
||||||
|
switch v := jsonData["maxConcurrentShardRequests"].(type) {
|
||||||
|
case float64:
|
||||||
|
maxConcurrentShardRequests = v
|
||||||
|
case string:
|
||||||
|
maxConcurrentShardRequests, err = strconv.ParseFloat(v, 64)
|
||||||
|
if err != nil {
|
||||||
|
maxConcurrentShardRequests = 256
|
||||||
|
}
|
||||||
|
default:
|
||||||
maxConcurrentShardRequests = 256
|
maxConcurrentShardRequests = 256
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user