wait 100ms before kicking a subscriber out

+ a test for indexer_service
This commit is contained in:
Anton Kaliaev
2019-02-07 17:17:56 +04:00
parent c6e3059e32
commit 165bb2abfe
4 changed files with 82 additions and 10 deletions
+2 -1
View File
@@ -38,6 +38,7 @@ import (
"context"
"errors"
"sync"
"time"
cmn "github.com/tendermint/tendermint/libs/common"
)
@@ -394,7 +395,7 @@ func (state *state) send(msg interface{}, tags map[string]string) {
// don't block on buffered channels
select {
case subscription.out <- Message{msg, tags}:
default:
case <-time.After(100 * time.Millisecond):
state.remove(clientID, qStr, ErrOutOfCapacity)
}
}