1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 10:14:04 +00:00

clarify how dispatchNow() works

This commit is contained in:
Samuel Štancl 2024-09-10 13:26:57 +02:00
parent 8e718ff7b9
commit e6ab0ee9af

View file

@ -102,6 +102,11 @@ class QueueTenancyBootstrapper implements TenancyBootstrapper
return;
}
if (tenant() && $previousTenant && $previousTenant->is(tenant())) {
// dispatchNow() was used and the tenant in the job is the same as the previous tenant
return;
}
if (tenant() && $previousTenant && $previousTenant->isNot(tenant())) {
// Revert back to the previous tenant (since Tenancy v3.8.5 this should should *likely* not happen)
tenancy()->initialize($previousTenant);