update minio service

This commit is contained in:
2024-10-18 18:45:34 +07:00
parent 8652c9e89a
commit f49f3e51b1
3 changed files with 36 additions and 6 deletions

View File

@@ -34,13 +34,19 @@ export class MinioService {
if (!id) {
return null;
}
let url = null;
const url = await this.minioClient.presignedUrl(
'GET',
this.configService.get('BUCKET_NAME') ?? 'epess',
`${category}/${id}`,
0,
);
try {
url = await this.minioClient.presignedUrl(
'GET',
this.configService.get('BUCKET_NAME') ?? 'epess',
`${category}/${id}`,
60 * 60 * 24 * 7,
);
} catch (error) {
console.log(error);
}
console.log(url);
return url;
}