@@ -12,6 +12,9 @@ class AsyncQueue extends DatabaseQueue
1212
1313 /** @var string */
1414 protected $ binaryArgs ;
15+
16+ /** @var string */
17+ protected $ connectionName ;
1518
1619 /**
1720 * @param \Illuminate\Database\Connection $database
@@ -21,11 +24,12 @@ class AsyncQueue extends DatabaseQueue
2124 * @param string $binary
2225 * @param string|array $binaryArgs
2326 */
24- public function __construct (Connection $ database , $ table , $ default = 'default ' , $ expire = 60 , $ binary = 'php ' , $ binaryArgs = '' )
27+ public function __construct (Connection $ database , $ table , $ default = 'default ' , $ expire = 60 , $ binary = 'php ' , $ binaryArgs = '' , $ connectionName = '' )
2528 {
2629 parent ::__construct ($ database , $ table , $ default , $ expire );
2730 $ this ->binary = $ binary ;
2831 $ this ->binaryArgs = $ binaryArgs ;
32+ $ this ->connectionName = $ connectionName ;
2933 }
3034
3135 /**
@@ -144,14 +148,14 @@ public function startProcess($queue, $id)
144148 */
145149 protected function getCommand ($ queue , $ id )
146150 {
147- $ connection = null ;
148- $ cmd = '%s artisan queue:async %d %d --env=%s --queue=%s ' ;
151+ $ connection = $ this -> connectionName ;
152+ $ cmd = '%s artisan queue:async %d %s --env=%s --queue=%s ' ;
149153 $ cmd = $ this ->getBackgroundCommand ($ cmd );
150154
151155 $ binary = $ this ->getPhpBinary ();
152156 $ environment = $ this ->container ->environment ();
153157
154- return sprintf ($ cmd , $ binary , $ id , $ connection , $ environment , $ queue );
158+ return sprintf ($ cmd , $ binary , $ id , $ connection , $ environment , $ this -> getQueue ( $ queue) );
155159 }
156160
157161 /**
0 commit comments