#![allow(dead_code)]
use super::RocksdbDatastore;
use util::generate_random_secret;
use std::env;
use std::path::Path;
pub fn get_options() -> (String, i32) {
let unique = generate_random_secret(8);
let path = Path::new("/tmp/test-rdb").join(unique);
let max_open_files_str = env::var("ROCKSDB_MAX_OPEN_FILES").unwrap_or("512".to_string());
let max_open_files = max_open_files_str.parse::<i32>().unwrap();
(path.to_str().unwrap().to_string(), max_open_files)
}
pub fn datastore() -> RocksdbDatastore {
let (path, max_open_files) = get_options();
RocksdbDatastore::new(&path[..], Some(max_open_files)).unwrap()
}