cache local instance (#572)

* cache local instance

fix #564

* don't use local instance cache for plm

* use instance cache for plm, but initialize it

* cargo fmt
This commit is contained in:
fdb-hiroshima
2019-05-10 22:59:34 +02:00
committed by Baptiste Gelez
parent 5b50f90d2b
commit 773fbfe7c8
20 changed files with 123 additions and 88 deletions
+2 -2
View File
@@ -118,7 +118,7 @@ pub fn create(
slug.clone(),
form.title.to_string(),
String::from(""),
Instance::get_local(&*conn)
Instance::get_local()
.expect("blog::create: instance error")
.id,
)
@@ -348,7 +348,7 @@ pub fn atom_feed(name: String, rockets: PlumeRocket) -> Option<Content<String>>
let conn = &*rockets.conn;
let feed = FeedBuilder::default()
.title(blog.title.clone())
.id(Instance::get_local(&*conn)
.id(Instance::get_local()
.ok()?
.compute_box("~", &name, "atom.xml"))
.entries(