Skip to content

Commit 7428740

Browse files
committed
Re-bootstrap on each queue job
1 parent 80f5e2c commit 7428740

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

ProcessMaker/Application.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,9 @@ public function bootstrapWith(array $bootstrappers)
112112

113113
return parent::bootstrapWith($bootstrappers);
114114
}
115+
116+
public function resetHasBeenBootstrapped()
117+
{
118+
$this->hasBeenBootstrapped = false;
119+
}
115120
}

ProcessMaker/Providers/ProcessMakerServiceProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,10 @@ private static function bootstrapTenantApp(JobProcessing|JobRetryRequested $even
268268
if (!isset(self::$tenantAppContainers[$tenantId])) {
269269
$tenantApp = require app()->bootstrapPath('app.php');
270270
$tenantApp->instance('landlordValues', self::$landlordValues);
271-
$tenantApp->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();
272271
self::$tenantAppContainers[$tenantId] = $tenantApp;
273272
}
273+
self::$tenantAppContainers[$tenantId]->resetHasBeenBootstrapped();
274+
self::$tenantAppContainers[$tenantId]->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();
274275

275276
// Change the job's app service container to the tenant app
276277
$event->job->getRedisQueue()->setContainer(self::$tenantAppContainers[$tenantId]);

0 commit comments

Comments
 (0)