bfile/filed/src/db.rs

12 lines
301 B
Rust

/*
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);
redis::Client::open(format!("redis://{}:{}/", env.redis.host, env.redis.port))
}