mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-22 09:19:08 +00:00
services: fix timer draining
Ref. #3736. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
parent
35c2c5cc0e
commit
827acfca23
1 changed files with 8 additions and 2 deletions
|
@ -471,7 +471,10 @@ func (s *Server) Shutdown() {
|
|||
session.iteratorsLock.Lock()
|
||||
session.finalize()
|
||||
if !session.timer.Stop() {
|
||||
<-session.timer.C
|
||||
select {
|
||||
case <-session.timer.C:
|
||||
default:
|
||||
}
|
||||
}
|
||||
session.iteratorsLock.Unlock()
|
||||
}
|
||||
|
@ -2596,7 +2599,10 @@ func (s *Server) terminateSession(reqParams params.Params) (any, *neorpc.Error)
|
|||
session.iteratorsLock.Lock()
|
||||
session.finalize()
|
||||
if !session.timer.Stop() {
|
||||
<-session.timer.C
|
||||
select {
|
||||
case <-session.timer.C:
|
||||
default:
|
||||
}
|
||||
}
|
||||
delete(s.sessions, strSID)
|
||||
session.iteratorsLock.Unlock()
|
||||
|
|
Loading…
Reference in a new issue