Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions glean-core/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,8 @@ impl Glean {
return data.persist_ping_lifetime_data();
}

self.event_storage().sync_event_data();

Ok(())
}

Expand Down
9 changes: 9 additions & 0 deletions glean-core/src/event_database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,15 @@ impl EventDatabase {
result
}

pub fn sync_event_data(&self) {
let files = self.event_store_files.read().unwrap();
for (name, file) in &*files {
if let Err(e) = file.sync_all() {
log::error!("Failed to sync event data for {name}: {e}");
}
}
}

/// Clears all stored events, both in memory and on-disk.
pub fn clear_all(&self) -> Result<()> {
// safe unwrap, only error case is poisoning
Expand Down