Skip to content

Commit

Permalink
keep stat() and list() lastModified upto same resolution
Browse files Browse the repository at this point in the history
fixes #1632
  • Loading branch information
harshavardhana committed Apr 13, 2022
1 parent deb9ab4 commit 09a3dee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api-list.go
Expand Up @@ -22,6 +22,7 @@ import (
"fmt"
"net/http"
"net/url"
"time"

"github.com/minio/minio-go/v7/pkg/s3utils"
)
Expand Down Expand Up @@ -239,6 +240,7 @@ func (c *Client) listObjectsV2Query(ctx context.Context, bucketName, objectPrefi
if err != nil {
return listBucketResult, err
}
listBucketResult.Contents[i].LastModified = listBucketResult.Contents[i].LastModified.Round(time.Second)
}

for i, obj := range listBucketResult.CommonPrefixes {
Expand Down Expand Up @@ -384,7 +386,7 @@ func (c *Client) listObjectVersions(ctx context.Context, bucketName string, opts
info := ObjectInfo{
ETag: trimEtag(version.ETag),
Key: version.Key,
LastModified: version.LastModified,
LastModified: version.LastModified.Round(time.Second),
Size: version.Size,
Owner: version.Owner,
StorageClass: version.StorageClass,
Expand Down Expand Up @@ -600,6 +602,7 @@ func (c *Client) listObjectsQuery(ctx context.Context, bucketName, objectPrefix,
if err != nil {
return listBucketResult, err
}
listBucketResult.Contents[i].LastModified = listBucketResult.Contents[i].LastModified.Round(time.Second)
}

for i, obj := range listBucketResult.CommonPrefixes {
Expand Down

0 comments on commit 09a3dee

Please sign in to comment.