Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Queue Jobs trigger before the model is created #17

Open
ragingdave opened this issue Oct 1, 2018 · 1 comment
Open

Queue Jobs trigger before the model is created #17

ragingdave opened this issue Oct 1, 2018 · 1 comment

Comments

@ragingdave
Copy link
Contributor

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.

@ragingdave
Copy link
Contributor Author

ragingdave commented Mar 4, 2019

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;
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant