@@ -58,10 +58,11 @@ discard block |
||
| 58 | 58 | //TODO insert a timeout |
| 59 | 59 | //TODO try...catch with destruct |
| 60 | 60 | $companyId = $this->argument('companyId'); |
| 61 | - if (is_numeric($companyId)) |
|
| 62 | - $this->makeForeground(Company::findOrFail($companyId)); |
|
| 63 | - else |
|
| 64 | - $this->syncAll(); |
|
| 61 | + if (is_numeric($companyId)) { |
|
| 62 | + $this->makeForeground(Company::findOrFail($companyId)); |
|
| 63 | + } else { |
|
| 64 | + $this->syncAll(); |
|
| 65 | + } |
|
| 65 | 66 | } |
| 66 | 67 | |
| 67 | 68 | /** |
@@ -81,13 +82,15 @@ discard block |
||
| 81 | 82 | if ($this->option('background')) { |
| 82 | 83 | \Log::debug(self::BACKGROUND_MOD_MEX); |
| 83 | 84 | $this->info(self::BACKGROUND_MOD_MEX); |
| 84 | - foreach ($companies as $company) |
|
| 85 | - $this->makeBackground($company); |
|
| 85 | + foreach ($companies as $company) { |
|
| 86 | + $this->makeBackground($company); |
|
| 87 | + } |
|
| 86 | 88 | \Log::debug(self::BACKGROUND_COMPLETED_MEX); |
| 87 | 89 | $this->info(self::BACKGROUND_COMPLETED_MEX); |
| 88 | - } else |
|
| 89 | - foreach ($companies as $company) |
|
| 90 | + } else { |
|
| 91 | + foreach ($companies as $company) |
|
| 90 | 92 | $this->makeForeground($company); |
| 93 | + } |
|
| 91 | 94 | } |
| 92 | 95 | |
| 93 | 96 | /** |
@@ -97,7 +100,8 @@ discard block |
||
| 97 | 100 | private function makeBackground(Company $company) |
| 98 | 101 | { |
| 99 | 102 | $event = $this->schedule->command('optimise:meetings ' . $company->id)->withoutOverlapping(); |
| 100 | - if ($event->isDue($this->laravel)) |
|
| 101 | - $event->run($this->laravel); |
|
| 103 | + if ($event->isDue($this->laravel)) { |
|
| 104 | + $event->run($this->laravel); |
|
| 105 | + } |
|
| 102 | 106 | } |
| 103 | 107 | } |