Skip to content

Commit

Permalink
Fixed issue for wrong creation_time for non-nsfs buckets while listin…
Browse files Browse the repository at this point in the history
…g objects.

Signed-off-by: Aayush Chouhan <achouhan@redhat.com>
  • Loading branch information
achouhan09 committed May 9, 2024
1 parent add6523 commit 5b535cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/api/bucket_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,9 @@ module.exports = {
required: ['name'],
properties: {
name: { $ref: 'common_api#/definitions/bucket_name' },
creation_date: {
idate: true
},
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/server/system_services/bucket_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,10 @@ async function list_buckets(req) {
);
return {
buckets: _.map(buckets_by_name, function(bucket) {
return _.pick(bucket, 'name');
return {
name: bucket.name,
creation_date: bucket._id.getTimestamp().getTime()
};
})
};
}
Expand Down

0 comments on commit 5b535cb

Please sign in to comment.