Xuanwo commented on code in PR #2206:
URL:
https://github.com/apache/incubator-opendal/pull/2206#discussion_r1184869029
##########
core/src/services/s3/backend.rs:
##########
@@ -1017,22 +1018,27 @@ impl Accessor for S3Backend {
async fn stat(&self, path: &str, args: OpStat) -> Result<RpStat> {
// Stat root always returns a DIR.
if path == "/" {
+ // TODO: check if bucket exists
return Ok(RpStat::new(Metadata::new(EntryMode::DIR)));
}
- let resp = self
- .core
- .s3_head_object(path, args.if_none_match(), args.if_match())
- .await?;
-
- let status = resp.status();
-
- match status {
- StatusCode::OK => parse_into_metadata(path,
resp.headers()).map(RpStat::new),
- StatusCode::NOT_FOUND if path.ends_with('/') => {
+ if path.ends_with('/') {
+ let (_, mut pager) = self.list(path,
OpList::default().with_limit(1)).await?;
Review Comment:
Please call `list_objects` directly instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]