diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/database/mod.rs | 8 | ||||
-rw-r--r-- | src/database/redis/mod.rs | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/database/mod.rs b/src/database/mod.rs index 82bbea5..e676008 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -233,7 +233,7 @@ mod tests { let client = redis::Client::open(uri.clone()).unwrap(); let millisecond = Duration::from_millis(1); let mut retries: usize = 0; - const MAX_RETRIES: usize = 10 * 1000/*ms*/; + const MAX_RETRIES: usize = 60 * 1000/*ms*/; while let Err(err) = client.get_connection() { if err.is_connection_refusal() { async_std::task::sleep(millisecond).await; @@ -252,14 +252,16 @@ mod tests { #[async_std::test] async fn test_redis_storage_basic_operations() { - let (_, mut redis, backend) = get_redis_backend().await; + let (tempdir, mut redis, backend) = get_redis_backend().await; test_backend_basic_operations(backend).await; redis.kill().expect("Redis wasn't running"); + drop(tempdir); } #[async_std::test] async fn test_redis_storage_channel_support() { - let (_, mut redis, backend) = get_redis_backend().await; + let (tempdir, mut redis, backend) = get_redis_backend().await; test_backend_get_channel_list(backend).await; redis.kill().expect("Redis wasn't running"); + drop(tempdir); } } diff --git a/src/database/redis/mod.rs b/src/database/redis/mod.rs index 2377fac..faf9c13 100644 --- a/src/database/redis/mod.rs +++ b/src/database/redis/mod.rs @@ -263,7 +263,7 @@ impl Storage for RedisStorage { .take(limit); match std::panic::AssertUnwindSafe(posts.collect::<Vec<serde_json::Value>>()).catch_unwind().await { Ok(posts) => feed["children"] = json!(posts), - Err(err) => return Err(StorageError::new(ErrorKind::Other, "Unknown error encountered while assembling feed, see logs for more info")) + Err(_) => return Err(StorageError::new(ErrorKind::Other, "Unknown error encountered while assembling feed, see logs for more info")) } } return Ok(Some(feed)); |