mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-02 23:22:49 +00:00
Merge pull request #3737 from nspcc-dev/fix-timer-drain
services: fix timer draining
This commit is contained in:
commit
727262a95a
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