1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-14 05:24:03 +00:00

[2.1.0] Fix queue race conditions (#178)

* Add TenantDoesNotExist exception, fix queued migrator serialization

* wip

* Apply fixes from StyleCI

* Use only one config for  queueing

* Apply fixes from StyleCI

* rename test

* rename test
This commit is contained in:
Samuel Štancl 2019-10-17 13:55:10 +02:00 committed by GitHub
parent e98db460ec
commit 3e78410d8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 78 additions and 28 deletions

View file

@ -16,12 +16,12 @@ class QueuedTenantDatabaseMigrator implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/** @var Tenant */
protected $tenant;
/** @var string */
protected $tenantId;
public function __construct(Tenant $tenant)
{
$this->tenant = $tenant;
$this->tenantId = $tenant->id;
}
/**
@ -32,7 +32,7 @@ class QueuedTenantDatabaseMigrator implements ShouldQueue
public function handle()
{
Artisan::call('tenants:migrate', [
'--tenants' => [$this->tenant->id],
'--tenants' => [$this->tenantId],
]);
}
}