mirror of
https://github.com/archtechx/tenancy.git
synced 2026-05-06 18:04:03 +00:00
Rollback config if bootstrap fails
This commit is contained in:
parent
8fda84fcee
commit
34115e84c7
1 changed files with 9 additions and 2 deletions
|
|
@ -60,8 +60,15 @@ class LogTenancyBootstrapper implements TenancyBootstrapper
|
|||
$this->defaultConfig = $this->config->get('logging.channels');
|
||||
$channels = $this->getChannels();
|
||||
|
||||
$this->configureChannels($channels, $tenant);
|
||||
$this->forgetChannels($channels);
|
||||
try {
|
||||
$this->configureChannels($channels, $tenant);
|
||||
$this->forgetChannels($channels);
|
||||
} catch (\Throwable $exception) {
|
||||
$this->config->set('logging.channels', $this->defaultConfig);
|
||||
$this->forgetChannels($channels);
|
||||
|
||||
throw $exception;
|
||||
}
|
||||
}
|
||||
|
||||
public function revert(): void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue