Skip to content

Commit

Permalink
Revert "closes #57"
Browse files Browse the repository at this point in the history
This reverts commit 275b8b0.
  • Loading branch information
marvin-j97 committed Jun 3, 2024
1 parent 275b8b0 commit eb3d873
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/journal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,6 @@ pub struct Journal {
pub shards: Sharded<JournalShard>,
}

impl Drop for Journal {
fn drop(&mut self) {
log::trace!("Dropping Journal, trying to flush");

match self.flush(PersistMode::SyncAll) {
Ok(()) => {
log::trace!("Flushed journal successfully");
}
Err(e) => {
log::error!("Flush error on drop: {e:?}");
}
}
}
}

impl Journal {
pub fn recover_memtables<P: AsRef<Path>>(
path: P,
Expand Down
11 changes: 11 additions & 0 deletions src/keyspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,19 @@ pub struct KeyspaceInner {

impl Drop for KeyspaceInner {
fn drop(&mut self) {
log::trace!("Dropping Keyspace, trying to flush journal");

self.stop_signal.send();

match self.journal.flush(PersistMode::SyncAll) {
Ok(()) => {
log::trace!("Flushed journal successfully");
}
Err(e) => {
log::error!("Flush error on drop: {e:?}");
}
}

while self
.active_background_threads
.load(std::sync::atomic::Ordering::Relaxed)
Expand Down

0 comments on commit eb3d873

Please sign in to comment.