Skip to content

Commit

Permalink
Another small change
Browse files Browse the repository at this point in the history
  • Loading branch information
Lol3rrr committed Oct 30, 2023
1 parent 0ec4df5 commit 1f35ffc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/storage/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,17 @@ impl StorageBackend for FileStorage {
let path = self.path.clone();

Box::pin(async move {
if path.exists() {
tokio::fs::File::create(&path).await.map_err(|e| ())?;
if !path.exists() {
tokio::fs::File::create(&path).await.map_err(|e| {
tracing::error!("Creating file {:?}", e);
()
})?;
}

tokio::fs::write(&path, &content).await.map_err(|e| ())
tokio::fs::write(&path, &content).await.map_err(|e| {
tracing::error!("Writing File {:?}", e);
()
})
})
}

Expand Down

0 comments on commit 1f35ffc

Please sign in to comment.