Skip to content

Commit

Permalink
Err rather than panic failing to create queues_dir_path (#5079)
Browse files Browse the repository at this point in the history
  • Loading branch information
dholroyd authored Jun 5, 2024
1 parent cc921f7 commit b57eb12
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion quickwit/quickwit-ingest/src/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,15 @@ pub struct Queues {

impl Queues {
pub async fn open(queues_dir_path: &Path) -> crate::Result<Queues> {
tokio::fs::create_dir_all(queues_dir_path).await.unwrap();
tokio::fs::create_dir_all(queues_dir_path)
.await
.map_err(|error| {
IngestServiceError::IoError(format!(
"failed to create WAL directory `{}`: {}",
queues_dir_path.display(),
error
))
})?;
let record_log = MultiRecordLogAsync::open(queues_dir_path).await?;
Ok(Queues { record_log })
}
Expand Down

0 comments on commit b57eb12

Please sign in to comment.