-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PDOException when dispatching job with DynamoDbModel model as argument #132
Comments
Can you show the code that leads to this error? |
Basically I was sending a model as an argument to job constructor and then, assigning it to a local var. use App\Models\Dynamo\Feed;
use Illuminate\Contracts\Queue\ShouldQueue;
class UpdateFeedJob extends Job implements ShouldQueue
{
protected $feed = NULL;
public function __construct(Feed $feed) {
$this->feed = $feed;
}
public function handle(){
//handle job
}
} |
Ah ok. For now, you can do this: class UpdateFeedJob extends Job implements ShouldQueue
{
use SerializesModels;
protected $feed = NULL;
public function __construct(Feed $feed) {
$this->feed = $feed;
}
public function handle(){
//handle job
}
/**
* @override
*/
public function restoreModel($value)
{
return Feed::find($value->id);
}
} |
Does it help? can this be closed? |
Looks like there's no issue now... Closing for now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The exception is thrown from
App\Jobs\Job->__wakeup
(implemented in Illuminate\Queue\SerializesModels)File:
vendor/illuminate/database/Connection.php in execute at line 330
The text was updated successfully, but these errors were encountered: