bfile/filed/src/db.rs

12 lines
324 B
Rust
Raw Normal View History

2023-10-01 02:14:35 +02:00
/*
db.rs - The database adapter
*/
use redis::{Client, RedisError};
use crate::env::Env;
pub fn redis_conn(env: Env) -> Result<Client, RedisError> {
log::info!("Connecting to redis DB on {}", env.redis.host);
2023-10-01 10:40:37 +02:00
redis::Client::open(format!("redis://:{}@{}:{}/", env.redis.pass, env.redis.host, env.redis.port))
2023-10-01 02:14:35 +02:00
}