"artisan queue:work --daemon --sleep=1 --tries=10 --queue=issue" i use at console. maybe long time run. i dont know .
and then ,i get so many failed job in database . i check the log , found so many error message like this.
and then ,i get so many failed job in database . i check the log , found so many error message like this.
exception 'RuntimeException' with message 'Can't swap PDO instance while within transaction.' in /data/lightning5/vendor/laravel/framework/src/Illuminate/Database/Connection.php:854
php /data/lightning5/app/../artisan queue:work --daemon --sleep=1 --tries=5 --queue=task
I add DB::reconnect();
in the first line in handle method, and it's solved.
Like:
public function handle() {
DB::reconnect();
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community