Browse Source

`statObject` and `statFile` methods added to minio service

pull/2/head
Rob Colbert 3 years ago
parent
commit
ee4bcde597
  1. 15
      app/services/minio.js

15
app/services/minio.js

@ -80,6 +80,21 @@ class MinioService extends SiteService {
throw error;
}
}
async statObject (bucket, key) {
try {
const stat = await this.minio.statObject(bucket, key);
return stat;
} catch (error) {
this.log.error('failed to stat MinIO object', { bucket, key, error });
throw error;
}
}
async statFile (file) {
file.stat = await this.statObject(file.bucket, file.key);
return file.stat;
}
}
module.exports = {

Loading…
Cancel
Save