diff --git a/app/services/minio.js b/app/services/minio.js index 8856982..79d09ae 100644 --- a/app/services/minio.js +++ b/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 = {