mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-25 03:47:18 +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
|
||||
details.
|
||||
- `SessionExpirationTime` is a lifetime of iterator session in seconds. It is set
|
||||
to `TimePerBlock` seconds by default and is relevant only if `SessionEnabled`
|
||||
is set to `true`.
|
||||
to `TimePerBlock` seconds (but not less than 5s) by default and is relevant
|
||||
only if `SessionEnabled` is set to `true`.
|
||||
- `SessionBackedByMPT` is a flag forcing JSON-RPC server into using MPT-backed
|
||||
storage for delayed iterator traversal. If `true`, then iterator resources got
|
||||
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.SessionExpirationTime <= 0 {
|
||||
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))
|
||||
}
|
||||
if conf.SessionPoolSize <= 0 {
|
||||
|
|
Loading…
Reference in a new issue