...
This commit is contained in:
@@ -35,12 +35,6 @@ impl Server {
|
||||
return Ok(storage.clone());
|
||||
}
|
||||
|
||||
// Check database limit if set
|
||||
if let Some(max_db) = self.option.max_databases {
|
||||
if self.selected_db >= max_db {
|
||||
return Err(DBError(format!("DB index {} is out of range (max: {})", self.selected_db, max_db - 1)));
|
||||
}
|
||||
}
|
||||
|
||||
// Create new database file
|
||||
let db_file_path = std::path::PathBuf::from(self.option.dir.clone())
|
||||
@@ -58,10 +52,8 @@ impl Server {
|
||||
Ok(storage)
|
||||
}
|
||||
|
||||
fn should_encrypt_db(&self, db_index: u64) -> bool {
|
||||
// You can implement logic here to determine which databases should be encrypted
|
||||
// For now, let's say databases with even numbers are encrypted if key is provided
|
||||
self.option.encryption_key.is_some() && db_index % 2 == 0
|
||||
fn should_encrypt_db(&self, _db_index: u64) -> bool {
|
||||
self.option.encrypt
|
||||
}
|
||||
|
||||
pub async fn handle(
|
||||
|
Reference in New Issue
Block a user