From 0d973a6544e1afc2f3052ef9b78a9cce1f42545c Mon Sep 17 00:00:00 2001 From: Ly Tuan Kiet Date: Thu, 5 Dec 2024 21:14:00 +0700 Subject: [PATCH] refactor: update getRoomRecordUrl method in MinioService for improved promise handling - Changed the implementation of the `getRoomRecordUrl` method to use `await` with the Promise constructor for better readability and consistency. - This adjustment enhances the asynchronous handling of the method, ensuring a more straightforward promise resolution process. --- src/Minio/minio.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Minio/minio.service.ts b/src/Minio/minio.service.ts index 6abf7a7..0298ac9 100644 --- a/src/Minio/minio.service.ts +++ b/src/Minio/minio.service.ts @@ -139,7 +139,7 @@ export class MinioService { } // get the record url from minio by searching for the file starting with roomId and ending with .mp4 and returning the presigned url async getRoomRecordUrl(roomId: string) { - return new Promise(async (resolve, reject) => { + return await new Promise(async (resolve, reject) => { const stream = this.minioClient.listObjects(this.configService.get('BUCKET_NAME') ?? 'epess', `records/${roomId}`, true) const items: BucketItem[] = []