@@ -84,9 +84,6 @@ const (
8484 evDispatchReturn string = "d"
8585)
8686
87- // jobSinkBlockDuration is the max duration to block when reading from the job stream.
88- var jobSinkBlockDuration = 5 * time .Second
89-
9087// pendingEventTTL is the TTL for pending events.
9188var pendingEventTTL = 2 * time .Minute
9289
@@ -160,7 +157,7 @@ func AddNode(ctx context.Context, poolName string, rdb *redis.Client, opts ...No
160157 return nil , fmt .Errorf ("AddNode: failed to join pool ticker replicated map %q: %w" , tickerMapName (poolName ), err )
161158 }
162159 poolSink , err = poolStream .NewSink (ctx , "events" ,
163- soptions .WithSinkBlockDuration (jobSinkBlockDuration ),
160+ soptions .WithSinkBlockDuration (o . jobSinkBlockDuration ),
164161 soptions .WithSinkAckGracePeriod (o .ackGracePeriod ))
165162 if err != nil {
166163 return nil , fmt .Errorf ("AddNode: failed to create events sink for stream %q: %w" , poolStreamName (poolName ), err )
@@ -170,7 +167,7 @@ func AddNode(ctx context.Context, poolName string, rdb *redis.Client, opts ...No
170167 if err != nil {
171168 return nil , fmt .Errorf ("AddNode: failed to create node event stream %q: %w" , nodeStreamName (poolName , nodeID ), err )
172169 }
173- nodeReader , err = nodeStream .NewReader (ctx , soptions .WithReaderBlockDuration (jobSinkBlockDuration ), soptions .WithReaderStartAtOldest ())
170+ nodeReader , err = nodeStream .NewReader (ctx , soptions .WithReaderBlockDuration (o . jobSinkBlockDuration ), soptions .WithReaderStartAtOldest ())
174171 if err != nil {
175172 return nil , fmt .Errorf ("AddNode: failed to create node event reader for stream %q: %w" , nodeStreamName (poolName , nodeID ), err )
176173 }
0 commit comments