Use db-path from Config

This commit is contained in:
Tony Klink 2024-01-25 21:13:55 -06:00
parent df15dba3cc
commit 9f29f6cd07
Signed by: klink
GPG key ID: 85175567C4D19231

View file

@ -198,9 +198,7 @@ pub struct NostrSqlite {
impl NostrSqlite { impl NostrSqlite {
pub async fn new(config: Arc<ServiceConfig>) -> Self { pub async fn new(config: Arc<ServiceConfig>) -> Self {
let env_db_path = std::env::var("DATABASE_URL").unwrap_or("/tmp/sqlite.db".to_string()); let cfg = Config::new(config.get_db_path());
let cfg = Config::new(env_db_path);
let pool = cfg.create_pool(Runtime::Tokio1).unwrap(); let pool = cfg.create_pool(Runtime::Tokio1).unwrap();
if NostrSqlite::run_migrations(&pool).await { if NostrSqlite::run_migrations(&pool).await {