@@ -8,25 +8,24 @@ use std::{str::FromStr, time::Duration};
8
8
9
9
use redis:: AsyncCommands as _;
10
10
use svix_server:: {
11
- cfg:: { CacheType , Configuration } ,
11
+ cfg:: { Configuration , QueueType } ,
12
12
core:: types:: { ApplicationId , EndpointId , MessageAttemptTriggerType , MessageId } ,
13
13
queue:: {
14
14
new_pair, MessageTask , QueueTask , TaskQueueConsumer , TaskQueueDelivery , TaskQueueProducer ,
15
15
} ,
16
- redis:: { new_redis_clustered_unpooled , new_redis_pool, new_redis_pool_clustered, RedisPool } ,
16
+ redis:: { new_redis_pool, new_redis_pool_clustered, RedisPool } ,
17
17
} ;
18
18
19
19
// TODO: Don't copy this from the Redis queue test directly, place the fn somewhere both can access
20
- pub async fn get_pool ( cfg : Configuration ) -> RedisPool {
21
- match cfg. cache_type {
22
- CacheType :: RedisCluster => {
23
- new_redis_pool_clustered ( cfg. redis_dsn . as_ref ( ) . unwrap ( ) . as_str ( ) , & cfg) . await
20
+ async fn get_pool ( cfg : & Configuration ) -> RedisPool {
21
+ match cfg. queue_type {
22
+ QueueType :: RedisCluster => {
23
+ new_redis_pool_clustered ( cfg. redis_dsn . as_deref ( ) . unwrap ( ) , cfg) . await
24
24
}
25
- CacheType :: RedisClusterUnpooled => {
26
- new_redis_clustered_unpooled ( cfg. redis_dsn . as_ref ( ) . unwrap ( ) . as_str ( ) ) . await
25
+ QueueType :: Redis => new_redis_pool ( cfg. redis_dsn . as_deref ( ) . unwrap ( ) , cfg) . await ,
26
+ _ => {
27
+ panic ! ( "This test should only be run when redis is configured as the queue backend" )
27
28
}
28
- CacheType :: Redis => new_redis_pool ( cfg. redis_dsn . as_ref ( ) . unwrap ( ) . as_str ( ) , & cfg) . await ,
29
- _ => panic ! ( "This test should only be run when redis is configured as the cache provider" ) ,
30
29
}
31
30
}
32
31
@@ -44,7 +43,7 @@ async fn test_many_queue_consumers_inner(prefix: &str, delay: Option<Duration>)
44
43
45
44
// This test assumes an empty queue, so load Redis and delete the test key
46
45
{
47
- let pool = get_pool ( cfg. clone ( ) ) . await ;
46
+ let pool = get_pool ( & cfg) . await ;
48
47
let mut conn = pool. get ( ) . await . unwrap ( ) ;
49
48
50
49
let _: ( ) = conn
0 commit comments