You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I attempted to use Concurrency::run() it failed as the threads did not have the context of the current tenant anymore. Is there a way to ensure that tenancy context is provided to the concurrency facade? Has anyone had any luck doing that?
For example:
// presumed that the Tenant has already been made current in scope
[$countUsers, $countPatients] = \Concurrency::run([
User::count(),
Patient::count(),
]);
dd($countUsers, $countPatients);
Provided you have two models that have the traits UsesTenantConnection This code above fails to query as my tenant connection has no database by default, so, that empty database does not exist.
The queries work just fine outside of the concurrency facade in this example.
The text was updated successfully, but these errors were encountered:
Relevant context: https://laravel.com/docs/11.x/concurrency
When I attempted to use Concurrency::run() it failed as the threads did not have the context of the current tenant anymore. Is there a way to ensure that tenancy context is provided to the concurrency facade? Has anyone had any luck doing that?
For example:
Provided you have two models that have the traits
UsesTenantConnection
This code above fails to query as my tenant connection has no database by default, so, that empty database does not exist.The queries work just fine outside of the concurrency facade in this example.
The text was updated successfully, but these errors were encountered: