mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-21 23:29:38 +00:00
Merge pull request #3529 from nspcc-dev/fix-sessionexpiration-default
This commit is contained in:
commit
4fe9597dd5
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