From 2f7a5cbf563be603dc49233786769376445320b1 Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Wed, 24 Nov 2021 22:07:25 +0900 Subject: [PATCH] Cache local instance user on start --- src/main.rs | 4 +++- src/routes/blogs.rs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 243a0b91..49eeb812 100755 --- a/src/main.rs +++ b/src/main.rs @@ -57,7 +57,9 @@ fn init_pool() -> Option { builder = builder.max_size(max_size); }; 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) } diff --git a/src/routes/blogs.rs b/src/routes/blogs.rs index df4da910..b8b00f33 100644 --- a/src/routes/blogs.rs +++ b/src/routes/blogs.rs @@ -442,6 +442,7 @@ mod tests { ) .unwrap(); Instance::cache_local(conn); + Instance::cache_local_instance_user(conn); instance }); let mut user = NewUser::default();