mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 14:14:04 +00:00
Add extra dispatchNow tenancy init check
This commit is contained in:
parent
ccb68f5400
commit
518ac4947c
1 changed files with 3 additions and 1 deletions
|
|
@ -108,7 +108,9 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
// Queue tenancy
|
||||
$this->app['events']->listen(\Illuminate\Queue\Events\JobProcessing::class, function ($event) {
|
||||
if (array_key_exists('tenant_id', $event->job->payload())) {
|
||||
tenancy()->initialize(tenancy()->find($event->job->payload()['tenant_id']));
|
||||
if (! tenancy()->initialized) { // dispatchNow
|
||||
tenancy()->initialize(tenancy()->find($event->job->payload()['tenant_id']));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue