Skip to content

Commit 7523481

Browse files
HagarMeirtock-ibm
authored andcommitted
add sanity check
Signed-off-by: Hagar Meir <[email protected]>
1 parent a00045b commit 7523481

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

request/pool.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ type PoolOptions struct {
7171

7272
// NewPool constructs a new requests pool
7373
func NewPool(logger types.Logger, inspector RequestInspector, options PoolOptions, striker Striker) *Pool {
74+
if options.FirstStrikeThreshold < 2*options.BatchTimeout {
75+
logger.Warnf("FirstStrikeThreshold should be at least 2*BatchTimeout")
76+
return nil
77+
}
78+
7479
rp := &Pool{
7580
logger: logger,
7681
inspector: inspector,

0 commit comments

Comments
 (0)