Add preview URL logging and clean up MinIO verbose logs
- Add logging for generated preview URLs with truncated URL for security - Remove verbose logging from MinIO listObjectsV2 operations - Add proper handling for folder prefixes returned by MinIO - Keep only essential error/debug information in file listing
This commit is contained in:
@@ -26,16 +26,17 @@ export const listFiles = async (prefix: string = '', recursive: boolean = false)
|
||||
try {
|
||||
const stream = client.listObjectsV2(bucketName, prefix, recursive);
|
||||
|
||||
console.log(`Starting listObjectsV2 with prefix: "${prefix}", recursive: ${recursive}`);
|
||||
|
||||
stream.on('data', (obj) => {
|
||||
// Skip objects without a name
|
||||
if (!obj || typeof obj.name !== 'string') {
|
||||
console.log('Skipping invalid object:', obj);
|
||||
// Handle folder prefixes returned by MinIO
|
||||
if (obj && obj.prefix) {
|
||||
folders.add(obj.prefix);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`Object received: "${obj.name}", size: ${obj.size}, etag: ${obj.etag}`);
|
||||
// Skip objects without a name
|
||||
if (!obj || typeof obj.name !== 'string') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!recursive) {
|
||||
if (prefix) {
|
||||
|
||||
Reference in New Issue
Block a user