Merge pull request #187 from meilisearch/export-snapshots

Re-export rocksdb snapshot function
This commit is contained in:
Clément Renault 2019-09-17 12:54:14 +02:00 committed by GitHub
commit 5a17b5a63b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,4 +121,11 @@ impl Database {
pub fn common_index(&self) -> Arc<CommonIndex> {
self.common.clone()
}
pub fn checkpoint_to<P>(&self, path: P) -> Result<(), Error>
where P: AsRef<Path>,
{
let checkpoint = rocksdb::checkpoint::Checkpoint::new(&self.inner)?;
Ok(checkpoint.create_checkpoint(path)?)
}
}