Feb 25, 2021
0
Level 6
Running Spatie's MediaLibrary conversions with Supervisor
Hi all
I have a multi-tenant application where I use supervisor to run some queue workers and also use Spatie's media library extension. I have the MedLibrary extension conifgured to save conversions of files to my public filesystem when a user uploads a file like this:
public function registerMediaConversions(Media $media = null)
{
$this->addMediaConversion('avatar')
->width(256)
->height(256)
->format('png')
->performOnCollections('avatars');
$this->addMediaConversion('thumb')
->width(64)
->height(64)
->format('png')
->performOnCollections('avatars');
$this->addMediaConversion('cover')
->width(1500)
->format('png')
->performOnCollections('covers');
}
This worked fine when I was running it with *php artisan queue:work", but I'm getting failed jobs when running this with supervisor with the following error:
League\Flysystem\FileNotFoundException: File not found at path: 12/20210225_10_53_30pm.jpg in /var/www/my-app/vendor/league/flysystem/src/Filesystem.php:389
From what I can see, supervisor might be looking in the wrong place for these files to convert? How can I correct this?
Please or to participate in this conversation.