Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterate result of ListObjectsEnumAsync caused memory increased #1263

Open
MRJauhari opened this issue Feb 7, 2025 · 0 comments
Open

Iterate result of ListObjectsEnumAsync caused memory increased #1263

MRJauhari opened this issue Feb 7, 2025 · 0 comments

Comments

@MRJauhari
Copy link

Hi guys, i create a function that listing the content inside s3 folder, the memory increased when i iterate result from listObjectsEnumAsync.

public async Task<List<string>?> GetItemsFromDirectory(string path) { List<string> listDirectory = new List<string>(); string prefix = path + '/'; try { var listArgs = new ListObjectsArgs() .WithBucket(_garageConfig.BucketName) .WithPrefix(prefix) .WithRecursive(true); await foreach (var item in _minioClient.ListObjectsEnumAsync(listArgs).Reverse().ConfigureAwait(false)) if (item.Size > 0) { // empty process } _logger!.LogInformation("Successfully retrieved list of items in {0} directory", prefix); } catch (Exception e) { _logger!.LogError("[ListDirectory] Exception: {0}",e); return null; } return listDirectory; }

am i missed the implementation of listObjectsEnumAsync?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant