codebar-ag / laravel-flysystem-cloudinary

Cloudinary Flysystem integration with Laravel.
https://www.cloudinary.com
MIT License
8 stars 5 forks source link

[Bug]: we have thousands of directories so we get a nice long loop until rate limited #59

Closed robclancy closed 1 month ago

robclancy commented 4 months ago

What happened?

https://github.com/codebar-ag/laravel-flysystem-cloudinary/blob/v4.2/src/FlysystemCloudinaryAdapter.php#L686

With thousands of directories this causes issues. Either that or there is an infinite loop somehow.

Package Version

4.2

PHP Version

8.2

Laravel Version

11

Which operating systems does with happen with?

Linux

StanBarrows commented 4 months ago

Hey @robclancy

Thanks for your message.

When I quickly review our code now, you might be correct that this method does not look like a proper way to check a file's existence for thousands of folders. But because we've never had to solve a case with thousands of folders, I think that's okay.

So there are two options we can consider:

  1. We would accept a pull request with an updated approach to handle this case and maintain the updated code in the future.
  2. We can build a test setup with such a use case and find a solution. However, this would take some time because it is not currently on our priority list.

Best regards Sebastian

robclancy commented 4 months ago

I have since just started a new environment on cloudinary to start fresh.

StanBarrows commented 4 months ago

Hey @robclancy

Cool! If I can support you in any way let me know.

Best regards Sebastian