typo
This commit is contained in:
parent
57b7cc904c
commit
4936995f2b
@ -59,6 +59,7 @@ class ReportCache extends Command
|
|||||||
$reports = Report::orderBy('name')->get();
|
$reports = Report::orderBy('name')->get();
|
||||||
|
|
||||||
foreach ($reports as $report) {
|
foreach ($reports as $report) {
|
||||||
|
try {
|
||||||
$class = Utility::getClassInstance($report, false);
|
$class = Utility::getClassInstance($report, false);
|
||||||
|
|
||||||
if (empty($class)) {
|
if (empty($class)) {
|
||||||
@ -72,6 +73,11 @@ class ReportCache extends Command
|
|||||||
Cache::remember('reports.totals.' . $report->id, $ttl, function () use ($class) {
|
Cache::remember('reports.totals.' . $report->id, $ttl, function () use ($class) {
|
||||||
return $class->getGrandTotal();
|
return $class->getGrandTotal();
|
||||||
});
|
});
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
|
||||||
|
report($e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,8 +51,12 @@ class Version2117 extends Listener
|
|||||||
|
|
||||||
protected function cacheReports()
|
protected function cacheReports()
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
Report::all()->each(function ($report) {
|
Report::all()->each(function ($report) {
|
||||||
Cache::put('reports.totals.' . $report->id, Utility::getClassInstance($report)->getGrandTotal());
|
Cache::put('reports.totals.' . $report->id, Utility::getClassInstance($report)->getGrandTotal());
|
||||||
});
|
});
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
report($e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user