improvement: cache actual destination

This commit is contained in:
Timo Kösters 2020-12-06 11:05:51 +01:00
parent 45086b54b3
commit d62f17a91a
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
4 changed files with 74 additions and 35 deletions

View file

@ -76,7 +76,7 @@ impl Database {
}
/// Load an existing database or create a new one.
pub fn load_or_create(config: Config) -> Result<Self> {
pub async fn load_or_create(config: Config) -> Result<Self> {
let path = config
.database_path
.clone()
@ -106,7 +106,7 @@ impl Database {
let (admin_sender, admin_receiver) = mpsc::unbounded();
let db = Self {
globals: globals::Globals::load(db.open_tree("global")?, config)?,
globals: globals::Globals::load(db.open_tree("global")?, config).await?,
users: users::Users {
userid_password: db.open_tree("userid_password")?,
userid_displayname: db.open_tree("userid_displayname")?,