From ee4bcde597155633b9a93c0860b7d600b39da3e7 Mon Sep 17 00:00:00 2001 From: rob Date: Fri, 30 Sep 2022 16:03:04 -0400 Subject: [PATCH] `statObject` and `statFile` methods added to minio service --- app/services/minio.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 = {