nova-media-library
nova-media-library copied to clipboard
Queue Jobs trigger before the model is created
It seems that the queue jobs for the conversions/responsive are potentially run before the model gets created. My assumption is that the queue job gets kicked off and ran before the final save of the model is performed, so maybe it's just that the fillFromAttribute needs to use the saved model event rather than just adding the asset to the collection.
This can be fixed outside this package, and IMHO probably should be. You can extend the base PerformConversions Job and add a delay just in case whatever filesystem used takes too long or if the queue job is ran too quickly for any other stuff happening in the request.
class PerformMediaConversions extends PerformConversions
{
/**
* The number of seconds before the job should be made available.
*
* @var \DateTimeInterface|\DateInterval|int|null
*/
public $delay = 5;
}