refactor(services/azfile): Check if dir exists before create #3649
refactor(services/azfile): Check if dir exists before create #3649ZutJoe wants to merge 2 commits intoapache:mainfrom
Conversation
| } | ||
| for dir in dirs { | ||
| let resp = self.azfile_create_dir(dir).await?; | ||
| let resp = self.azfile_create_dir(p).await?; |
There was a problem hiding this comment.
This change seems wrong.
Given this case: a/b/c:
create_dir("a/b/")failed sincea/doesn't exist.create_dir("a/")succeed.- But write
a/b/cstill failed sincea/b/doesn't exist.
There was a problem hiding this comment.
fix
I'm not sure I got it right in #3646 , My English is not good
There was a problem hiding this comment.
Sorry for not make it clear in this issue.
The check means sending azfile_get_path_properties call before calling azfile_create_dir to avoid extra API calls.
Take a/b/c as an example:
- Check if
a/b/exist -> No - Check if
a/exist -> No - Create
a/ - Create
a/b/
In the best case: if a/b/ exists, we can avoid two APIs of create_dir.
There was a problem hiding this comment.
I think I understand. Thank you for your patience
I will close the pr
|
Hi, does closing this PR mean you're abandoning the issue? It's OK to work on the same PR if you still have interest without closing it. |
I have submitted another PR at #3652 Or should I continue to submit in this PR |
It's better to continue work on the same PR. But since you have already start a new PR, we can move discussion there instead. |
refactor #3646