Skip to content

Commit

Permalink
Updated shard file manager stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
hoytak committed Jan 30, 2025
1 parent c1f3675 commit d64897d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mdb_shard/src/shard_file_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ impl ShardFileManager {
async fn new_from_builder(sbp: ShardFileManagerOptions) -> Result<Arc<Self>> {
let shard_directory = std::path::absolute(sbp.shard_directory)?;

// Make sure the shard directory exists; create it if not.
if !shard_directory.exists() {
std::fs::create_dir_all(&shard_directory)?;
}

// Clean up old shards if needed
if sbp.clean_expired_shards {
MDBShardFile::clean_expired_shards(&shard_directory, sbp.shard_expiration_delete_buffer_secs)?;
Expand Down

0 comments on commit d64897d

Please sign in to comment.