Closed andreshg112 closed 4 years ago
I'm guessing your worker environment needs to be initialized in some way.
What does TaskError::getWorkerTrace()
return?
There hasn't been any further activity, so I'm closing this issue. Please comment with further information, we can always reopen the issue.
The problem is the App instance falls out of scope when the handler Closure gets serialized, so Laravel abstractions become unusable therein. Additionally, Model classes need some special handling when it comes to reconnecting with the database, so if you include any in your Closure's static variables, they won't work properly.
Fortunately, Laravel already figured out how to handle these issues in the context of PhpUnit tests and Queued Jobs, respectively. Specifically, the CreatesApplication and SerializesAndRestoresModelIdentifiers traits. So I've created a wrapper package around this package that leverages those traits to integrates it with Laravel a little better.
I have a database call in the callback. Is that a problem?