cache custom_domains list

follow #572 and cache the list of custom domains.
This commit is contained in:
Igor Galić
2019-05-26 22:00:36 +02:00
committed by Igor Galić
parent 2746e088ae
commit e6747de998
2 changed files with 17 additions and 2 deletions
+2
View File
@@ -42,6 +42,7 @@ extern crate webfinger;
use clap::App;
use diesel::r2d2::ConnectionManager;
use plume_models::{
blogs::Blog,
blogs::Host,
db_conn::{DbPool, PragmaForeignKey},
instance::Instance,
@@ -89,6 +90,7 @@ fn init_pool() -> Option<DbPool> {
.build(manager)
.ok()?;
Instance::cache_local(&pool.get().unwrap());
Blog::cache_custom_domains(&pool.get().unwrap());
Some(pool)
}