From 2a600183d50db969ece3c148a53261ffcba2bfbe Mon Sep 17 00:00:00 2001 From: rob Date: Wed, 15 May 2024 14:42:41 -0400 Subject: [PATCH] cleanup --- app/services/minio.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/app/services/minio.js b/app/services/minio.js index d5802c7..c106c5c 100644 --- a/app/services/minio.js +++ b/app/services/minio.js @@ -31,18 +31,16 @@ export default class MinioService extends SiteService { } async uploadFile (fileInfo) { - const result = await this.minio.fPutObject( + return this.minio.fPutObject( fileInfo.bucket, fileInfo.key, fileInfo.filePath, fileInfo.metadata ); - return result; } async downloadFile (fileInfo) { - const obj = await this.minio.fGetObject(fileInfo.bucket, fileInfo.key, fileInfo.filePath); - return obj; + return this.minio.fGetObject(fileInfo.bucket, fileInfo.key, fileInfo.filePath); } async openDownloadStream (fi) { @@ -51,20 +49,18 @@ export default class MinioService extends SiteService { const stream = await this.minio.getPartialObject(fi.bucket, fi.key, fi.range.start, length); return stream; } - const stream = await this.minio.getObject(fi.bucket, fi.key); - return stream; + return this.minio.getObject(fi.bucket, fi.key); } async removeObject (bucket, key) { - await this.minio.removeObject(bucket, key); + return this.minio.removeObject(bucket, key); } async statObject (bucket, key) { - const stat = await this.minio.statObject(bucket, key); - return stat; + return this.minio.statObject(bucket, key); } async statFile (file) { - return await this.statObject(file.bucket, file.key); + return this.statObject(file.bucket, file.key); } } \ No newline at end of file