ImageValueHandler does not remove downloaded images
Closed this issue · 2 comments
ImageValueHandler downloads product images from Akeneo, using method \Webgriffe\SyliusAkeneoPlugin\ApiClient::downloadFile. This method downloads the image files to the system temp dir, but the ImageValueHandler doesn't remove images from temp dir after using them, so that image files pile up and soon or later they end up filling up the disk.
The ImageValueHandler
must not delete the image after downloading it. That's because image is copied to the final location by Sylius using the \Sylius\Component\Core\Uploader\ImageUploader::upload
which is called by a pre_update
or pre_create
event listener:
So if the ImageValueHandler
would remove the the file the ImageUploder
will fail.
We should investigate if even the Sylius UI leaves temporary uploaded file or not.
It's PHP that deletes a temporary uploaded file right after the script finishes its execution. See: https://stackoverflow.com/questions/4653224/php-how-long-to-tmp-files-stay.
So we have to handle temporary downloaded images from Akeneo in some way...