mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 18:34:04 +00:00
Fix exit codes in TenantAwareCommand
This commit is contained in:
parent
245d998d59
commit
e0404622f0
1 changed files with 9 additions and 4 deletions
|
|
@ -10,7 +10,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
|||
|
||||
trait TenantAwareCommand
|
||||
{
|
||||
/** @return mixed|void */
|
||||
/** @return int */
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$tenants = $this->getTenants();
|
||||
|
|
@ -21,13 +21,18 @@ trait TenantAwareCommand
|
|||
});
|
||||
}
|
||||
|
||||
$exitCode = 0;
|
||||
foreach ($tenants as $tenant) {
|
||||
$tenant->run(function () {
|
||||
$this->laravel->call([$this, 'handle']);
|
||||
$result = $tenant->run(function () {
|
||||
return $this->laravel->call([$this, 'handle']);
|
||||
});
|
||||
|
||||
if ($result !== 0) {
|
||||
$exitCode = $result;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
return $exitCode;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue