Skip to content

Commit f00a6a5

Browse files
committed
add sanity check
Signed-off-by: Hagar Meir <hagar.meir@ibm.com>
1 parent 8bec044 commit f00a6a5

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
@@ -70,6 +70,11 @@ type PoolOptions struct {
7070

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

0 commit comments

Comments
 (0)