mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
add option to recompute room state
Hopefully we can make use of this state resolution code for more stuff in the future.
This commit is contained in:
parent
33598a79b7
commit
b1e14fad5c
5 changed files with 629 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ use crate::{
|
|||
};
|
||||
|
||||
mod cache;
|
||||
mod recompute;
|
||||
|
||||
/// Serializable information about a state event
|
||||
#[derive(Serialize, PartialEq, Eq)]
|
||||
|
|
@ -63,7 +64,11 @@ pub(crate) async fn run(
|
|||
|
||||
db.apply_migrations().await.map_err(Error::Database)?;
|
||||
|
||||
let room_states = cache::get_room_states().await;
|
||||
let room_states = if args.recompute {
|
||||
recompute::get_room_states(db)
|
||||
} else {
|
||||
cache::get_room_states().await
|
||||
};
|
||||
|
||||
serde_json::to_writer(std::io::stdout(), &room_states)?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue