Skip to content

Commit

Permalink
Processes configuration fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
luzrain committed Feb 10, 2024
1 parent 1cde1a4 commit 6b34f7f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function run(): int
group: $config['group'],
name: $processConfig['name'],
command: $processConfig['command'],
processes: $processConfig['processes'],
count: $processConfig['count'],
));
}

Expand Down
4 changes: 2 additions & 2 deletions src/Worker/ProcessWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ public function __construct(
string|null $group,
string|null $name,
private readonly string $command,
int $processes,
int $count,
) {
parent::__construct(
name: $name ?? $command,
count: $processes,
count: $count,
user: $user,
group: $group,
onStart: $this->onStart(...),
Expand Down
4 changes: 1 addition & 3 deletions src/Worker/SchedulerWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ private function runSymfonyCommand(Application $application, string $command): i
}

// Execute in a forked process
$identifiers = $this->getEventLoop()->getIdentifiers();
\array_walk($identifiers, $this->getEventLoop()->disable(...));
$this->getEventLoop()->stop();
$this->detach();
\cli_set_process_title($command);
\pcntl_signal(SIGINT, SIG_IGN);

Expand Down
4 changes: 4 additions & 0 deletions src/config/configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@
->isRequired()
->cannotBeEmpty()
->end()
->integerNode('count')
->info('Processes count')
->defaultValue(1)
->end()
->end()
->end()
->end()
Expand Down

0 comments on commit 6b34f7f

Please sign in to comment.