1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-05-06 20:54:02 +00:00

Rollback config if bootstrap fails

This commit is contained in:
lukinovec 2026-04-13 15:23:04 +02:00
parent 8fda84fcee
commit 34115e84c7

View file

@ -60,8 +60,15 @@ class LogTenancyBootstrapper implements TenancyBootstrapper
$this->defaultConfig = $this->config->get('logging.channels'); $this->defaultConfig = $this->config->get('logging.channels');
$channels = $this->getChannels(); $channels = $this->getChannels();
try {
$this->configureChannels($channels, $tenant); $this->configureChannels($channels, $tenant);
$this->forgetChannels($channels); $this->forgetChannels($channels);
} catch (\Throwable $exception) {
$this->config->set('logging.channels', $this->defaultConfig);
$this->forgetChannels($channels);
throw $exception;
}
} }
public function revert(): void public function revert(): void