mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-22 19:29:39 +00:00
rpcsrv: set MaxFindStorageResultItems to default if not specified
Do not use RPC configuration constructor for this, some external services may skip this part. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
parent
dd7c762ff9
commit
f5b0489d74
2 changed files with 5 additions and 2 deletions
|
@ -78,7 +78,6 @@ func LoadFile(configPath string) (Config, error) {
|
||||||
PingTimeout: 90 * time.Second,
|
PingTimeout: 90 * time.Second,
|
||||||
},
|
},
|
||||||
RPC: RPC{
|
RPC: RPC{
|
||||||
MaxFindStorageResultItems: DefaultMaxFindStorageResultItems,
|
|
||||||
MaxNEP11Tokens: 100,
|
MaxNEP11Tokens: 100,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -303,6 +303,10 @@ func New(chain Ledger, conf config.RPC, coreServer *network.Server,
|
||||||
conf.MaxFindResultItems = config.DefaultMaxFindResultItems
|
conf.MaxFindResultItems = config.DefaultMaxFindResultItems
|
||||||
log.Info("MaxFindResultItems is not set or wrong, setting default value", zap.Int("MaxFindResultItems", config.DefaultMaxFindResultItems))
|
log.Info("MaxFindResultItems is not set or wrong, setting default value", zap.Int("MaxFindResultItems", config.DefaultMaxFindResultItems))
|
||||||
}
|
}
|
||||||
|
if conf.MaxFindStorageResultItems <= 0 {
|
||||||
|
conf.MaxFindStorageResultItems = config.DefaultMaxFindStorageResultItems
|
||||||
|
log.Info("MaxFindStorageResultItems is not set or wrong, setting default value", zap.Int("MaxFindStorageResultItems", config.DefaultMaxFindStorageResultItems))
|
||||||
|
}
|
||||||
if conf.MaxWebSocketClients == 0 {
|
if conf.MaxWebSocketClients == 0 {
|
||||||
conf.MaxWebSocketClients = defaultMaxWebSocketClients
|
conf.MaxWebSocketClients = defaultMaxWebSocketClients
|
||||||
log.Info("MaxWebSocketClients is not set or wrong, setting default value", zap.Int("MaxWebSocketClients", defaultMaxWebSocketClients))
|
log.Info("MaxWebSocketClients is not set or wrong, setting default value", zap.Int("MaxWebSocketClients", defaultMaxWebSocketClients))
|
||||||
|
|
Loading…
Reference in a new issue