mirror of
https://github.com/grafana/grafana.git
synced 2026-07-30 08:18:10 -05:00
bugfix: fix proper type of setting maxConcurrentShardRequests (#47120)
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/Masterminds/semver"
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||
@@ -95,8 +96,17 @@ func newInstanceSettings() datasource.InstanceFactoryFunc {
|
||||
timeInterval = ""
|
||||
}
|
||||
|
||||
maxConcurrentShardRequests, ok := jsonData["maxConcurrentShardRequests"].(float64)
|
||||
if !ok {
|
||||
var maxConcurrentShardRequests float64
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user