Fmt
This commit is contained in:
parent
8a85a68dbb
commit
cc5ad0f27c
3 changed files with 14 additions and 5 deletions
|
|
@ -1,4 +1,7 @@
|
||||||
use super::{Database, Transaction, models::*};
|
use super::{
|
||||||
|
Database, Transaction,
|
||||||
|
models::{EventRecord, FileManifest, StoredDocumentVersion, VaultUpdateId},
|
||||||
|
};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
|
||||||
impl Database {
|
impl Database {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,10 @@
|
||||||
use super::{Database, Transaction, models::*};
|
use super::{
|
||||||
|
Database, Transaction,
|
||||||
|
models::{
|
||||||
|
DocumentId, EventBatch, FileManifest, StoredDocumentVersion, VaultId, VaultSnapshot,
|
||||||
|
VaultUpdateId,
|
||||||
|
},
|
||||||
|
};
|
||||||
use anyhow::{Result, ensure};
|
use anyhow::{Result, ensure};
|
||||||
|
|
||||||
impl Database {
|
impl Database {
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ async fn websocket(
|
||||||
// notifications are only wakeups, so lag and commit/notify crashes are safe.
|
// notifications are only wakeups, so lag and commit/notify crashes are safe.
|
||||||
let result = async {
|
let result = async {
|
||||||
loop {
|
loop {
|
||||||
let batch = state.database.events_after(&vault, after).await.map_err(|error| server_error(error.into()))?;
|
let batch = state.database.events_after(&vault, after).await.map_err(server_error)?;
|
||||||
|
|
||||||
if !batch.events.is_empty() {
|
if !batch.events.is_empty() {
|
||||||
let head = batch.head_event_id;
|
let head = batch.head_event_id;
|
||||||
|
|
@ -107,12 +107,12 @@ async fn websocket(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Some(Ok(Message::Ping(_))) | Some(Ok(Message::Pong(_))) => {},
|
Some(Ok(Message::Ping(_) | Message::Pong(_))) => {},
|
||||||
_ => break,
|
_ => break,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}.await;
|
}.await;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue