Skip to content

Commit

Permalink
ActionController::backend(): Add condition to check which backend sho…
Browse files Browse the repository at this point in the history
…uld be used

- If both are available
  • Loading branch information
sukhwinder33445 committed Nov 21, 2023
1 parent b8b58db commit cbf4541
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/Director/Web/Controller/ActionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Icinga\Module\Director\Integration\Icingadb\IcingadbBackend;
use Icinga\Module\Director\Integration\BackendInterface;
use Icinga\Module\Director\Integration\MonitoringModule\Monitoring;
use Icinga\Module\Director\ProvidedHook\Icingadb\IcingadbSupport;
use Icinga\Module\Director\Web\Controller\Extension\CoreApi;
use Icinga\Module\Director\Web\Controller\Extension\DirectorDb;
use Icinga\Module\Director\Web\Controller\Extension\RestApi;
Expand Down Expand Up @@ -255,7 +256,7 @@ protected function backend(): BackendInterface
$modules->loadEnabledModules();
}

if ($modules->hasLoaded('icingadb')) {
if ($modules->hasLoaded('icingadb') && IcingadbSupport::useIcingaDbAsBackend()) {
$this->backend = new IcingadbBackend();
} else {
$this->backend = new Monitoring();
Expand Down

0 comments on commit cbf4541

Please sign in to comment.