Skip to content

Commit e05d55a

Browse files
committed
Make config cache run in subprocess
1 parent 77303cc commit e05d55a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

ProcessMaker/Jobs/RefreshArtisanCaches.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
namespace ProcessMaker\Jobs;
44

55
use Illuminate\Bus\Queueable;
6+
use Illuminate\Console\Application;
67
use Illuminate\Contracts\Queue\ShouldBeUnique;
78
use Illuminate\Contracts\Queue\ShouldQueue;
89
use Illuminate\Foundation\Bus\Dispatchable;
910
use Illuminate\Queue\InteractsWithQueue;
1011
use Illuminate\Queue\Middleware\WithoutOverlapping;
1112
use Illuminate\Support\Facades\Artisan;
13+
use Illuminate\Support\Facades\Process;
1214

1315
class RefreshArtisanCaches implements ShouldQueue
1416
{
@@ -34,7 +36,11 @@ public function handle()
3436
];
3537

3638
if (app()->configurationIsCached()) {
37-
Artisan::call('config:cache', $options);
39+
// Run in a separate process to avoid the tenant being set.
40+
// We do not use a tenant-specific config cache file.
41+
Process::path(base_path())
42+
->env(['TENANT' => ''])
43+
->run(Application::formatCommandString('config:cache'))->throw();
3844
} else {
3945
Artisan::call('queue:restart', $options);
4046

0 commit comments

Comments
 (0)