mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 09:54:05 +00:00
Merge branch 'fix-queue-race-conditions' of github.com:stancl/tenancy into fix-queue-race-conditions
This commit is contained in:
commit
aa7d315aa7
3 changed files with 3 additions and 3 deletions
|
|
@ -133,7 +133,7 @@ class DatabaseManager
|
||||||
{
|
{
|
||||||
$database = $tenant->getDatabaseName();
|
$database = $tenant->getDatabaseName();
|
||||||
$manager = $this->getTenantDatabaseManager($tenant);
|
$manager = $this->getTenantDatabaseManager($tenant);
|
||||||
|
|
||||||
if ($this->app['config']['tenancy.queue_database_creation'] ?? false) {
|
if ($this->app['config']['tenancy.queue_database_creation'] ?? false) {
|
||||||
QueuedTenantDatabaseCreator::withChain($afterCreating)->dispatch($manager, $database);
|
QueuedTenantDatabaseCreator::withChain($afterCreating)->dispatch($manager, $database);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ class TenantManager
|
||||||
$this->ensureTenantCanBeCreated($tenant);
|
$this->ensureTenantCanBeCreated($tenant);
|
||||||
|
|
||||||
$this->storage->createTenant($tenant);
|
$this->storage->createTenant($tenant);
|
||||||
|
|
||||||
/** @var \Illuminate\Contracts\Queue\ShouldQueue[]|callable[] $afterCreating */
|
/** @var \Illuminate\Contracts\Queue\ShouldQueue[]|callable[] $afterCreating */
|
||||||
$afterCreating = [];
|
$afterCreating = [];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -262,7 +262,7 @@ class TenantManagerTest extends TestCase
|
||||||
$tenant = Tenant::new()->save();
|
$tenant = Tenant::new()->save();
|
||||||
|
|
||||||
Queue::assertPushedWithChain(QueuedTenantDatabaseCreator::class, [
|
Queue::assertPushedWithChain(QueuedTenantDatabaseCreator::class, [
|
||||||
QueuedTenantDatabaseMigrator::class
|
QueuedTenantDatabaseMigrator::class,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// foreach (Queue::pushedJobs() as $job) {
|
// foreach (Queue::pushedJobs() as $job) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue