@@ -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 | /** |
@@ -74,7 +75,7 @@ discard block |
||
74 | 75 | try { |
75 | 76 | (new Optimise($company, $this->schedule, $this->laravel))->optimise()->save(); |
76 | 77 | $this->info('Optimisation ' . $company->id . ' completed'); |
77 | - }catch(OptimiseException $e) { |
|
78 | + } catch(OptimiseException $e) { |
|
78 | 79 | if ($e->isEmpty()) { |
79 | 80 | $mex = 'Company ' . $company->id . ' doesn\'t have sufficient data'; |
80 | 81 | $this->warn($mex); |
@@ -94,13 +95,15 @@ discard block |
||
94 | 95 | if ($this->option('background')) { |
95 | 96 | \Log::debug(self::BACKGROUND_MOD_MEX); |
96 | 97 | $this->info(self::BACKGROUND_MOD_MEX); |
97 | - foreach ($companies as $company) |
|
98 | - $this->makeBackground($company); |
|
98 | + foreach ($companies as $company) { |
|
99 | + $this->makeBackground($company); |
|
100 | + } |
|
99 | 101 | \Log::debug(self::BACKGROUND_COMPLETED_MEX); |
100 | 102 | $this->info(self::BACKGROUND_COMPLETED_MEX); |
101 | - } else |
|
102 | - foreach ($companies as $company) |
|
103 | + } else { |
|
104 | + foreach ($companies as $company) |
|
103 | 105 | $this->makeForeground($company); |
106 | + } |
|
104 | 107 | } |
105 | 108 | |
106 | 109 | /** |
@@ -110,7 +113,8 @@ discard block |
||
110 | 113 | private function makeBackground(Company $company) |
111 | 114 | { |
112 | 115 | $event = $this->schedule->command('optimise:meetings ' . $company->id)->withoutOverlapping(); |
113 | - if ($event->isDue($this->laravel)) |
|
114 | - $event->run($this->laravel); |
|
116 | + if ($event->isDue($this->laravel)) { |
|
117 | + $event->run($this->laravel); |
|
118 | + } |
|
115 | 119 | } |
116 | 120 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | \JWTFactory::setTTL(43200); |
35 | 35 | //config(['jwt.ttl' =>'43200']); //30 days |
36 | 36 | } |
37 | - }catch(JWTException $e) |
|
37 | + } catch(JWTException $e) |
|
38 | 38 | {} |
39 | 39 | |
40 | 40 | //this to add the remember me mode field in the new token, but we have the custom check that is an useless |