@@ -100,10 +100,10 @@ public function build()
100
100
}
101
101
102
102
// generate program configuration files for all consumers
103
- $ this ->generateWorkerConfigurations (array_keys ($ this ->consumers ), $ this ->commands ['rabbitmq_consumer ' ]);
103
+ $ this ->generateWorkerConfigurations (array_keys ($ this ->consumers ), $ this ->commands ['rabbitmq_consumer ' ], $ this -> commands [ ' max_messages ' ] );
104
104
105
105
// generate program configuration files for all multiple consumers
106
- $ this ->generateWorkerConfigurations (array_keys ($ this ->multipleConsumers ), $ this ->commands ['rabbitmq_multiple_consumer ' ]);
106
+ $ this ->generateWorkerConfigurations (array_keys ($ this ->multipleConsumers ), $ this ->commands ['rabbitmq_multiple_consumer ' ], $ this -> commands [ ' max_messages ' ] );
107
107
108
108
// start supervisor and reload configuration
109
109
$ this ->start ();
@@ -252,7 +252,7 @@ public function generateSupervisorConfiguration()
252
252
);
253
253
}
254
254
255
- private function generateWorkerConfigurations ($ names , $ command )
255
+ private function generateWorkerConfigurations ($ names , $ command, $ maxMessages = 250 )
256
256
{
257
257
if (0 === strpos ($ _SERVER ["SCRIPT_FILENAME " ], '/ ' )) {
258
258
$ executablePath = $ _SERVER ["SCRIPT_FILENAME " ];
@@ -266,7 +266,7 @@ private function generateWorkerConfigurations($names, $command)
266
266
$ name ,
267
267
array (
268
268
'name ' => $ name ,
269
- 'command ' => sprintf ($ command , 250 , $ name ),
269
+ 'command ' => sprintf ($ command , $ maxMessages , $ name ),
270
270
'executablePath ' => $ executablePath ,
271
271
'workerOutputLog ' => $ this ->paths ['worker_output_log_file ' ],
272
272
'workerErrorLog ' => $ this ->paths ['worker_error_log_file ' ],
0 commit comments