Using asynchronous queue, when configuring the database, I have two databases mysql
and mysql2
in config/database.php
:
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'forge'),
...
],
'mysql2' => [
'driver' => 'mysql',
'host' => env('DB_O2O_HOST', 'localhost'),
'database' => env('DB_O2O_DATABASE', 'forge'),
...
],
I put the jobs
table of the queue in mysql2
. When adding tasks to the queue, the default connection is mysql
. Can this be configured? ##config/queue.php To specify the connected database?
In the
model
constructor of the table, show the call