Skip to content

Commit

Permalink
fix memory leak in production enviroments;
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesBilbo committed Oct 17, 2022
1 parent 8f7c0c1 commit db35770
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 9 deletions.
12 changes: 12 additions & 0 deletions config/ignition.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,16 @@

'settings_file_path' => '',

'should_record' => env(
'IGNITION_RECORD',
env('APP_DEBUG', true) && env('APP_ENV', 'local') != 'production'
),

'recorders' => [
'jobs' => env('IGNITION_RECORD_JOBS', true),
'dumps' => env('IGNITION_RECORD_DUMPS', true),
'logs' => env('IGNITION_RECORD_LOGS', true),
'queries' => env('IGNITION_RECORD_QUERIES', true)
]

];
27 changes: 18 additions & 9 deletions src/IgnitionServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,24 @@ protected function registerLogHandler(): void

protected function startRecorders(): void
{
// TODO: Ignition feature toggles

$this->app->make(DumpRecorder::class)->start();

$this->app->make(LogRecorder::class)->start();

$this->app->make(QueryRecorder::class)->start();

$this->app->make(JobRecorder::class)->start();
if ($this->app->config['ignition.should_record']) {

if ($this->app->config['ignition.recorders.dumps']) {
$this->app->make(DumpRecorder::class)->start();
}

if ($this->app->config['ignition.recorders.logs']) {
$this->app->make(LogRecorder::class)->start();
}

if ($this->app->config['ignition.recorders.queries']) {
$this->app->make(QueryRecorder::class)->start();
}

if ($this->app->config['ignition.recorders.jobs']) {
$this->app->make(JobRecorder::class)->start();
}
}
}

protected function configureQueue(): void
Expand Down

0 comments on commit db35770

Please sign in to comment.