@@ -144,11 +144,21 @@ object RedisConnection{
144
144
val maxIdle : Int = 100
145
145
val maxTotal : Int = 100
146
146
147
- val commandTimeout : Duration = 30 .seconds // If using a blocking operation this is likely inappropriate.
148
- @ deprecated(" 0.5.2" , " Use Defaults.commandTimeout instead" )
149
- val requestTimeout : Duration = commandTimeout
147
+ // If using a blocking operation these is likely inappropriate.
148
+ // You want Command Timeout to be higher than RedisRequestTimeout
149
+ val ownedConnectionCommandTimeout : Duration = 10 .seconds
150
+ val ownedConnectionRedisRequestTimeout : Duration = 5 .seconds
151
+
152
+ // If using a blocking operation this is likely inappropriate.
153
+ val sharedConnectionCommandTimeout : Duration = 5 .seconds
154
+ val sharedConnectionRedisRequestTimeout : Duration = 5 .seconds
155
+
156
+
157
+ @ deprecated(" 0.5.2" , " Use Defaults.ownedConnectionCommandTimeout or Defaults. instead" )
158
+ val requestTimeout : Duration = 30 .seconds
159
+
160
+
150
161
151
- val redisRequestTimeout = 20 .seconds // If using a blocking operation this is likely inappropriate.
152
162
153
163
154
164
// TODO config
@@ -164,8 +174,8 @@ object RedisConnection{
164
174
TLSParameters .Default ,
165
175
None ,
166
176
Defaults .useTLS,
167
- Defaults .commandTimeout ,
168
- Defaults .redisRequestTimeout ,
177
+ Defaults .ownedConnectionCommandTimeout ,
178
+ Defaults .ownedConnectionRedisRequestTimeout ,
169
179
)
170
180
171
181
@ deprecated(" Use overload that takes a Network" , " 0.4.1" )
@@ -233,9 +243,9 @@ object RedisConnection{
233
243
_ <- Resource .eval(auth match {
234
244
case None => ().pure[F ]
235
245
case Some ((Some (username), password)) =>
236
- RedisCommands .auth[Redis [F , * ]](username, password).run(DirectConnection (out, commandTimeout , redisRequestTimeout)).void
246
+ RedisCommands .auth[Redis [F , * ]](username, password).run(DirectConnection (out, Duration . Inf , redisRequestTimeout)).void
237
247
case Some ((None , password)) =>
238
- RedisCommands .auth[Redis [F , * ]](password).run(DirectConnection (out, commandTimeout , redisRequestTimeout)).void
248
+ RedisCommands .auth[Redis [F , * ]](password).run(DirectConnection (out, Duration . Inf , redisRequestTimeout)).void
239
249
})
240
250
} yield RedisConnection .DirectConnection (out, commandTimeout, redisRequestTimeout)
241
251
}
@@ -252,8 +262,8 @@ object RedisConnection{
252
262
Defaults .idleTimeAllowedInPool,
253
263
Defaults .maxIdle,
254
264
Defaults .maxTotal,
255
- Defaults .commandTimeout ,
256
- Defaults .redisRequestTimeout ,
265
+ Defaults .ownedConnectionCommandTimeout ,
266
+ Defaults .ownedConnectionRedisRequestTimeout ,
257
267
)
258
268
259
269
@ deprecated(" Use overload that takes a Network" , " 0.4.1" )
@@ -338,9 +348,9 @@ object RedisConnection{
338
348
auth match {
339
349
case None => ().pure[F ]
340
350
case Some ((Some (username), password)) =>
341
- RedisCommands .auth[Redis [F , * ]](username, password).run(DirectConnection (socket, commandTimeout , redisRequestTimeout)).void
351
+ RedisCommands .auth[Redis [F , * ]](username, password).run(DirectConnection (socket, Duration . Inf , redisRequestTimeout)).void
342
352
case Some ((None , password)) =>
343
- RedisCommands .auth[Redis [F , * ]](password).run(DirectConnection (socket, commandTimeout , redisRequestTimeout)).void
353
+ RedisCommands .auth[Redis [F , * ]](password).run(DirectConnection (socket, Duration . Inf , redisRequestTimeout)).void
344
354
}
345
355
)
346
356
}
@@ -368,8 +378,8 @@ object RedisConnection{
368
378
Defaults .idleTimeAllowedInPool,
369
379
Defaults .maxIdle,
370
380
Defaults .maxTotal,
371
- Defaults .commandTimeout ,
372
- Defaults .redisRequestTimeout ,
381
+ Defaults .sharedConnectionCommandTimeout ,
382
+ Defaults .sharedConnectionRedisRequestTimeout ,
373
383
)
374
384
375
385
@ deprecated(" Use overload that takes a Network" , " 0.4.1" )
@@ -537,8 +547,8 @@ object RedisConnection{
537
547
Defaults .idleTimeAllowedInPool,
538
548
Defaults .maxIdle,
539
549
Defaults .maxTotal,
540
- Defaults .commandTimeout ,
541
- Defaults .redisRequestTimeout ,
550
+ Defaults .sharedConnectionCommandTimeout ,
551
+ Defaults .sharedConnectionRedisRequestTimeout ,
542
552
)
543
553
544
554
@ deprecated(" Use overload that takes a Network" , " 0.4.1" )
0 commit comments