mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Minor N+1 fixes
This commit is contained in:
parent
5118a01e7d
commit
1fbbaaad4d
@ -36,9 +36,9 @@ class QueryLogging
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Enable query logging for development
|
// Enable query logging for development
|
||||||
if (!Ninja::isHosted() || !config('beacon.enabled')) {
|
// if (!Ninja::isHosted() || !config('beacon.enabled')) {
|
||||||
return $next($request);
|
// return $next($request);
|
||||||
}
|
// }
|
||||||
|
|
||||||
$timeStart = microtime(true);
|
$timeStart = microtime(true);
|
||||||
DB::enableQueryLog();
|
DB::enableQueryLog();
|
||||||
@ -52,7 +52,7 @@ class QueryLogging
|
|||||||
$timeEnd = microtime(true);
|
$timeEnd = microtime(true);
|
||||||
$time = $timeEnd - $timeStart;
|
$time = $timeEnd - $timeStart;
|
||||||
|
|
||||||
// info("Query count = {$count}");
|
info("Query count = {$count}");
|
||||||
|
|
||||||
if($count > 175){
|
if($count > 175){
|
||||||
nlog("Query count = {$count}");
|
nlog("Query count = {$count}");
|
||||||
|
@ -93,7 +93,8 @@ class CreateEntityPdf implements ShouldQueue
|
|||||||
$this->contact = $invitation->contact;
|
$this->contact = $invitation->contact;
|
||||||
|
|
||||||
$this->client = $invitation->contact->client;
|
$this->client = $invitation->contact->client;
|
||||||
|
$this->client->load('company');
|
||||||
|
|
||||||
$this->disk = Ninja::isHosted() ? config('filesystems.default') : $disk;
|
$this->disk = Ninja::isHosted() ? config('filesystems.default') : $disk;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -107,7 +108,7 @@ class CreateEntityPdf implements ShouldQueue
|
|||||||
/* Init a new copy of the translator*/
|
/* Init a new copy of the translator*/
|
||||||
$t = app('translator');
|
$t = app('translator');
|
||||||
/* Set the locale*/
|
/* Set the locale*/
|
||||||
App::setLocale($this->contact->preferredLocale());
|
App::setLocale($this->client->locale());
|
||||||
|
|
||||||
/* Set customized translations _NOW_ */
|
/* Set customized translations _NOW_ */
|
||||||
$t->replace(Ninja::transformTranslations($this->client->getMergedSettings()));
|
$t->replace(Ninja::transformTranslations($this->client->getMergedSettings()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user