diff --git a/app/Jobs/Entity/CreateEntityPdf.php b/app/Jobs/Entity/CreateEntityPdf.php index 79a479ac9840..067706227384 100644 --- a/app/Jobs/Entity/CreateEntityPdf.php +++ b/app/Jobs/Entity/CreateEntityPdf.php @@ -91,8 +91,16 @@ class CreateEntityPdf implements ShouldQueue public function handle() { + /* Set the locale*/ App::setLocale($this->contact->preferredLocale()); + + /* Forget the singleton*/ App::forgetInstance('translator'); + + /* Init a new copy of the translator*/ + $t = app('translator'); + + /* Set customized translations _NOW_ */ Lang::replace(Ninja::transformTranslations($this->entity->client->getMergedSettings())); $this->entity->service()->deletePdf(); diff --git a/app/Jobs/Util/SchedulerCheck.php b/app/Jobs/Util/SchedulerCheck.php index 8a30e9b87b93..c96be09f0078 100644 --- a/app/Jobs/Util/SchedulerCheck.php +++ b/app/Jobs/Util/SchedulerCheck.php @@ -23,6 +23,8 @@ class SchedulerCheck implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; + public $tries = 1; + public function __construct() { } @@ -45,14 +47,18 @@ class SchedulerCheck implements ShouldQueue Artisan::call('migrate', ['--force' => true]); } catch (\Exception $e) { nlog("I wasn't able to migrate the data."); + nlog($e->getMessage()); + } - try { - Artisan::call('optimize'); + Artisan::call('clear-compiled'); + Artisan::call('cache:clear'); + Artisan::call('route:clear'); + Artisan::call('config:cache'); } catch (\Exception $e) { - nlog($e->getMessage()); nlog("I wasn't able to optimize."); + nlog($e->getMessage()); } @@ -60,6 +66,7 @@ class SchedulerCheck implements ShouldQueue Artisan::call('view:clear'); } catch (\Exception $e) { nlog("I wasn't able to clear the views."); + nlog($e->getMessage()); }