Ability to set timeout in OptimizerChain using config #3624
Unanswered
bansalvinay
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm implementing a CMS solution where I need top optimize images using media library. Some of these images take more than 60 seconds to optimize. When I looked through the code, I found out the conversion is getting timeout in optimisation step.
The process \"\"cwebp\" -m 6 -pass 10 -mt -q 60 '/var/www/package_name/releases/28/storage/media-library/temp/5MMXoAX1iKYQ8wsnTEVM9o8dKkK3Tnjp/9zeXslysD38k76MXKLBcesNcBOKtFJU1webp.png' -o '/var/www/package_name/releases/28/storage/media-library/temp/5MMXoAX1iKYQ8wsnTEVM9o8dKkK3Tnjp/9zeXslysD38k76MXKLBcesNcBOKtFJU1webp.png'\" exceeded the timeout of 60 seconds. at /var/www/package_name/releases/28/vendor/symfony/process/Process.php:1157)
I checked the documentation, it seems spatie / image-optimizer does have an option to call function setTimeout(seconds), but this ability is not provided through spatie media library.
Because of this, we're facing timeout issues in some files. The documentation of Spatie Image says :
For the OptimizerChain instance you can also set the maximum of time in seconds that each individual optimizer in a chain can use by calling setTimeout. The default value is 60 seconds. Adjusting this setting may be inevitable while working with large images (see e.g. [#187](https://github.com/spatie/image/pull/187)).
I think it would make sense if we can add this timout configuration setting in config file of media library. Please help me if there's any other way already to implement this which I may be missing.
Beta Was this translation helpful? Give feedback.
All reactions