mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-21 23:29:38 +00:00
rpcsrv: set minimal default SessionExpirationTime to 5s, fix #3509
Signed-off-by: Roman Khimov <roman@nspcc.ru>
This commit is contained in:
parent
f0ae14e4db
commit
f4b61b5a77
2 changed files with 5 additions and 2 deletions
|
@ -250,8 +250,8 @@ where:
|
||||||
enable `SessionBackedByMPT`, see `SessionBackedByMPT` documentation for more
|
enable `SessionBackedByMPT`, see `SessionBackedByMPT` documentation for more
|
||||||
details.
|
details.
|
||||||
- `SessionExpirationTime` is a lifetime of iterator session in seconds. It is set
|
- `SessionExpirationTime` is a lifetime of iterator session in seconds. It is set
|
||||||
to `TimePerBlock` seconds by default and is relevant only if `SessionEnabled`
|
to `TimePerBlock` seconds (but not less than 5s) by default and is relevant
|
||||||
is set to `true`.
|
only if `SessionEnabled` is set to `true`.
|
||||||
- `SessionBackedByMPT` is a flag forcing JSON-RPC server into using MPT-backed
|
- `SessionBackedByMPT` is a flag forcing JSON-RPC server into using MPT-backed
|
||||||
storage for delayed iterator traversal. If `true`, then iterator resources got
|
storage for delayed iterator traversal. If `true`, then iterator resources got
|
||||||
after `invoke*` calls will be released immediately. Further iterator traversing
|
after `invoke*` calls will be released immediately. Further iterator traversing
|
||||||
|
|
|
@ -274,6 +274,9 @@ func New(chain Ledger, conf config.RPC, coreServer *network.Server,
|
||||||
if conf.SessionEnabled {
|
if conf.SessionEnabled {
|
||||||
if conf.SessionExpirationTime <= 0 {
|
if conf.SessionExpirationTime <= 0 {
|
||||||
conf.SessionExpirationTime = int(protoCfg.TimePerBlock / time.Second)
|
conf.SessionExpirationTime = int(protoCfg.TimePerBlock / time.Second)
|
||||||
|
if conf.SessionExpirationTime < 5 {
|
||||||
|
conf.SessionExpirationTime = 5
|
||||||
|
}
|
||||||
log.Info("SessionExpirationTime is not set or wrong, setting default value", zap.Int("SessionExpirationTime", conf.SessionExpirationTime))
|
log.Info("SessionExpirationTime is not set or wrong, setting default value", zap.Int("SessionExpirationTime", conf.SessionExpirationTime))
|
||||||
}
|
}
|
||||||
if conf.SessionPoolSize <= 0 {
|
if conf.SessionPoolSize <= 0 {
|
||||||
|
|
Loading…
Reference in a new issue