Cache local instance user on start

This commit is contained in:
Kitaiti Makoto 2021-11-24 22:07:25 +09:00
parent 1506802c20
commit 2f7a5cbf56
2 changed files with 4 additions and 1 deletions

View File

@ -57,7 +57,9 @@ fn init_pool() -> Option<DbPool> {
builder = builder.max_size(max_size); builder = builder.max_size(max_size);
}; };
let pool = builder.build(manager).ok()?; let pool = builder.build(manager).ok()?;
Instance::cache_local(&pool.get().unwrap()); let conn = pool.get().unwrap();
Instance::cache_local(&conn);
Instance::cache_local_instance_user(&conn);
Some(pool) Some(pool)
} }

View File

@ -442,6 +442,7 @@ mod tests {
) )
.unwrap(); .unwrap();
Instance::cache_local(conn); Instance::cache_local(conn);
Instance::cache_local_instance_user(conn);
instance instance
}); });
let mut user = NewUser::default(); let mut user = NewUser::default();