1
0
Fork 0
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:
Samuel Štancl 2019-10-17 13:41:59 +02:00
commit aa7d315aa7
3 changed files with 3 additions and 3 deletions

View file

@ -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 {

View file

@ -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 = [];

View file

@ -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) {