@@ -13,7 +13,7 @@ class QueueRunCommand extends Command
1313 *
1414 * @var string
1515 */
16- protected $ name = 'queue:run {--queue=default} {--sleep=3} {--memory=128} {--timeout=3600 } {--limit=} ' ;
16+ protected $ name = 'queue:run {--queue=default} {--sleep=3} {--memory=128} {--timeout=0 } {--limit=} ' ;
1717
1818 /**
1919 * The command description.
@@ -50,7 +50,7 @@ public function __construct(QueueManager $manager)
5050
5151 /**
5252 * Execute the console command.
53- * Example: php pool queue:run --queue=reports --sleep=10 --memory=1024 --timeout=3600 --limit=
53+ * Example: php pool queue:run --queue=reports --sleep=10 --memory=1024 --timeout=0 --limit=
5454 *
5555 * @return int
5656 */
@@ -60,13 +60,21 @@ protected function handle(): int
6060 $ queue = $ this ->option ('queue ' , 'default ' );
6161 $ sleep = (int ) $ this ->option ('sleep ' , 3 );
6262 $ maxMemory = (int ) $ this ->option ('memory ' , 128 );
63- $ maxTime = (int ) $ this ->option ('timeout ' , 3600 );
64- $ maxLimit = $ this ->option ('limit ' );
6563
64+ $ maxTimeInput = $ this ->option ('timeout ' );
65+ $ maxTime = $ maxTimeInput !== 0 ? (int ) $ maxTimeInput : -1 ;
66+
67+ $ maxLimit = $ this ->option ('limit ' );
6668 $ maxLimit = $ maxLimit !== null ? (int ) $ maxLimit : null ;
6769
6870 $ this ->displaySuccess ("Starting queue worker on queue: {$ queue }" );
69- $ configInfo = "Configuration: sleep= {$ sleep }s, memory= {$ maxMemory }MB, timeout= {$ maxTime }s " ;
71+ $ configInfo = "Configuration: sleep= {$ sleep }s, memory= {$ maxMemory }MB, timeout= " ;
72+
73+ if ($ maxTime > 0 ) {
74+ $ configInfo .= "{$ maxTime }s " ;
75+ } else {
76+ $ configInfo .= "unlimited " ;
77+ }
7078
7179 if (!empty ($ maxLimit )) {
7280 $ configInfo .= ", limit= {$ maxLimit } jobs " ;
0 commit comments