bfile/filed/src/db.rs

13 lines
322 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:42:42 +02:00
redis::Client::open(format!("redis://:{}@{}:{}/", env.redis.pass, env.redis.host, env.redis.port))
2023-10-13 01:17:30 +02:00
}