Browse Source

fix: not put new post into reply timeline cache

master
hole-thu 2 years ago
parent
commit
289a19d4da
  1. 18
      src/models.rs

18
src/models.rs

@ -356,14 +356,16 @@ impl Post {
pub async fn refresh_cache(&self, rconn: &RdsConn, is_new: bool) { pub async fn refresh_cache(&self, rconn: &RdsConn, is_new: bool) {
join!( join!(
self.set_instance_cache(rconn), self.set_instance_cache(rconn),
future::join_all((if is_new { 0..5 } else { 1..5 }).map(|mode| async move { future::join_all((if is_new { [0, 2, 3, 4] } else { [1, 2, 3, 4] }).map(
PostListCache::init(None, mode, &rconn.clone()) |mode| async move {
.put(self) PostListCache::init(None, mode, &rconn.clone())
.await; .put(self)
PostListCache::init(Some(self.room_id), mode, &rconn.clone()) .await;
.put(self) PostListCache::init(Some(self.room_id), mode, &rconn.clone())
.await; .put(self)
})), .await;
}
)),
); );
} }

Loading…
Cancel
Save