[#XX] client: Terminate session in ReadIteratorItems
All checks were successful
DCO action / DCO (pull_request) Successful in 1m10s
Tests / Tests (1.19) (pull_request) Successful in 1m38s
Tests / Tests (1.20) (pull_request) Successful in 1m34s

* Make an invoker terminate session by its ID before return, otherwise,
  it may lead to `max session capacity reached error`.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
Airat Arifullin 2024-04-09 14:15:39 +03:00
parent 694daebb19
commit e7a05a49ff

View file

@ -29,6 +29,10 @@ func ReadIteratorItems(inv Invoker, batchSize int, contract util.Uint160, method
return arr, nil return arr, nil
} }
defer func() {
_ = inv.TerminateSession(sessionID)
}()
var shouldStop bool var shouldStop bool
res := arr res := arr
for !shouldStop { for !shouldStop {