Skip to content

Commit

Permalink
fix regression in previous commit: consume PendingDispatch *before* r…
Browse files Browse the repository at this point in the history
…everting context
  • Loading branch information
stancl committed Feb 19, 2025
1 parent b9cc63f commit ffad2db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Tenancy.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ public function run(Tenant $tenant, Closure $callback): mixed
$this->initialize($tenant);
$result = $callback($tenant);
} finally {
if ($result instanceof PendingDispatch) { // #1277
$result = null;
}

if ($originalTenant) {
$this->initialize($originalTenant);
} else {
$this->end();
}
}

if ($result instanceof PendingDispatch) { // #1277
$result = null;
}

return $result;
}

Expand Down

0 comments on commit ffad2db

Please sign in to comment.