fix warnings.

This commit is contained in:
appflowy 2021-12-21 13:59:51 +08:00
parent adce96f15b
commit b25db57fca
2 changed files with 3 additions and 3 deletions

View file

@ -39,7 +39,7 @@ impl RevisionMemoryCache {
return; return;
} }
} }
// FIXME: Remove outdated revisions to reduce memory usage // TODO: Remove outdated revisions to reduce memory usage
self.revs_map.insert(record.revision.rev_id, record.clone()); self.revs_map.insert(record.revision.rev_id, record.clone());
self.pending_write_revs.write().await.push(record.revision.rev_id); self.pending_write_revs.write().await.push(record.revision.rev_id);
self.make_checkpoint().await; self.make_checkpoint().await;
@ -92,7 +92,7 @@ impl RevisionMemoryCache {
*self.defer_save.write().await = Some(tokio::spawn(async move { *self.defer_save.write().await = Some(tokio::spawn(async move {
tokio::time::sleep(Duration::from_millis(300)).await; tokio::time::sleep(Duration::from_millis(300)).await;
let mut revs_write_guard = pending_write_revs.write().await; let mut revs_write_guard = pending_write_revs.write().await;
// FIXME: // TODO:
// It may cause performance issues because we hold the write lock of the // It may cause performance issues because we hold the write lock of the
// rev_order and the lock will be released after the checkpoint has been written // rev_order and the lock will be released after the checkpoint has been written
// to the disk. // to the disk.

View file

@ -272,7 +272,7 @@ impl CombinedSink {
} }
} }
// FIXME: return Option<&DocumentWSData> would be better // TODO: return Option<&DocumentWSData> would be better
pub(crate) async fn front(&self) -> Option<DocumentWSData> { self.shared.read().await.front().cloned() } pub(crate) async fn front(&self) -> Option<DocumentWSData> { self.shared.read().await.front().cloned() }
pub(crate) async fn push_front(&self, data: DocumentWSData) { self.shared.write().await.push_front(data); } pub(crate) async fn push_front(&self, data: DocumentWSData) { self.shared.write().await.push_front(data); }