Use canonical config path

This commit is contained in:
Andras Schmelczer 2024-12-08 15:01:50 +00:00
parent 46adcd9345
commit 53f1a3dcc6
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -9,9 +9,9 @@ pub struct AppState {
impl AppState {
pub async fn try_new() -> Result<Self> {
let path = std::path::Path::new(CONFIG_PATH);
let path = std::path::Path::new(CONFIG_PATH).canonicalize()?;
let config = Config::read(path).await?;
let config = Config::read(&path).await?;
let database = Database::try_new(&config.database).await?;
Ok(Self { config, database })