mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 00:14:04 +00:00
Terminating pipelines (#527)
* Return false from CreateDatabase job * Terminating pipeline tests
This commit is contained in:
parent
8f12dd8829
commit
126afcd0dd
2 changed files with 81 additions and 6 deletions
|
|
@ -31,12 +31,15 @@ class CreateDatabase implements ShouldQueue
|
|||
{
|
||||
event(new CreatingDatabase($this->tenant));
|
||||
|
||||
if ($this->tenant->getInternal('create_database') !== false) {
|
||||
$databaseManager->ensureTenantCanBeCreated($this->tenant);
|
||||
$this->tenant->database()->makeCredentials();
|
||||
$this->tenant->database()->manager()->createDatabase($this->tenant);
|
||||
|
||||
event(new DatabaseCreated($this->tenant));
|
||||
// Terminate execution of this job & other jobs in the pipeline
|
||||
if ($this->tenant->getInternal('create_database') === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$databaseManager->ensureTenantCanBeCreated($this->tenant);
|
||||
$this->tenant->database()->makeCredentials();
|
||||
$this->tenant->database()->manager()->createDatabase($this->tenant);
|
||||
|
||||
event(new DatabaseCreated($this->tenant));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue