1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-08-06 11:04:04 +00:00
This commit is contained in:
Samuel Stancl 2026-06-25 19:39:32 -07:00
parent e5234daed4
commit f9c827d698
No known key found for this signature in database
GPG key ID: BA146259A1E16C57

View file

@ -112,8 +112,8 @@ trait HasPending
} }
// Fired before the claim, so it can fire once per attempt, including for a candidate // Fired before the claim, so it can fire once per attempt, including for a candidate
// that ends up being claimed by a concurrent process (in which case the loop retries). // that ends up being claimed by a different process (in which case the loop retries).
// PendingTenantPulled (below) fires exactly once, for the pulled tenant. // PendingTenantPulled (below) fires exactly once, for the actually pulled tenant.
event(new PullingPendingTenant($pullCandidate)); event(new PullingPendingTenant($pullCandidate));
$tenant = DB::transaction(function () use ($pullCandidate, $attributes): ?Tenant { $tenant = DB::transaction(function () use ($pullCandidate, $attributes): ?Tenant {
@ -125,8 +125,8 @@ trait HasPending
return null; return null;
} }
// The tenant's pending_since was just cleared, and e.g. a PullingPendingTenant listener // The tenant's pending_since was just cleared, and a PullingPendingTenant listener
// may have made changes to the tenant, so re-fetch it to get it in the correct state. // may have made changes to the tenant, so re-fetch it to make sure it's up to date.
/** @var Model&Tenant $pulledTenant */ /** @var Model&Tenant $pulledTenant */
$pulledTenant = static::findOrFail($pullCandidate->getKey()); $pulledTenant = static::findOrFail($pullCandidate->getKey());