mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 09:54:05 +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
|
trait TenantAwareCommand
|
||||||
{
|
{
|
||||||
/** @return mixed|void */
|
/** @return int */
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
$tenants = $this->getTenants();
|
$tenants = $this->getTenants();
|
||||||
|
|
@ -21,13 +21,18 @@ trait TenantAwareCommand
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$exitCode = 0;
|
||||||
foreach ($tenants as $tenant) {
|
foreach ($tenants as $tenant) {
|
||||||
$tenant->run(function () {
|
$result = $tenant->run(function () {
|
||||||
$this->laravel->call([$this, 'handle']);
|
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