diff --git a/app/Http/Controllers/SelfUpdateController.php b/app/Http/Controllers/SelfUpdateController.php index aa313d712af1..c5738e692a81 100644 --- a/app/Http/Controllers/SelfUpdateController.php +++ b/app/Http/Controllers/SelfUpdateController.php @@ -112,6 +112,8 @@ class SelfUpdateController extends BaseController $zipFile->close(); + $zipFile = null; + nlog('Finished extracting files'); unlink($file); diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index 0f5d240033fb..523ded2a6954 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -129,12 +129,11 @@ class NinjaMailerJob implements ShouldQueue LightLogs::create(new EmailSuccess($this->nmo->company->company_key)) ->send(); - - nlog('Using ' . ((int) (memory_get_usage(true) / (1024 * 1024))) . 'MB '); + // nlog('Using ' . ((int) (memory_get_usage(true) / (1024 * 1024))) . 'MB '); $this->nmo = null; $this->company = null; - gc_collect_cycles(); + app('queue.worker')->shouldQuit = 1; } catch (\Exception | \RuntimeException | \Google\Service\Exception $e) { @@ -177,7 +176,7 @@ class NinjaMailerJob implements ShouldQueue $message = null; $this->nmo = null; $this->company = null; - gc_collect_cycles(); + app('queue.worker')->shouldQuit = 1; } @@ -204,7 +203,7 @@ class NinjaMailerJob implements ShouldQueue if ($this->nmo->to_user instanceof ClientContact) $this->logMailError($message, $this->nmo->to_user->client); - + } private function setMailDriver()