X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fredis%2Fasyncdatabasediscovery.cpp;h=b57955e049c60fc28ac8d37166c2c118d72095c5;hb=refs%2Fchanges%2F57%2F11757%2F3;hp=8723def2fad8ec6d61b3a967e63de82b4e242059;hpb=ece67088ea6c4f67b9d0db74477a9d5c614d7763;p=ric-plt%2Fsdl.git diff --git a/src/redis/asyncdatabasediscovery.cpp b/src/redis/asyncdatabasediscovery.cpp index 8723def..b57955e 100644 --- a/src/redis/asyncdatabasediscovery.cpp +++ b/src/redis/asyncdatabasediscovery.cpp @@ -1,5 +1,5 @@ /* - Copyright (c) 2018-2019 Nokia. + Copyright (c) 2018-2022 Nokia. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ std::shared_ptr AsyncDatabaseDiscovery::create(std::shar const boost::optional& addressIndex, std::shared_ptr logger) { - auto staticAddresses(staticDatabaseConfiguration.getServerAddresses()); + auto staticAddresses(staticDatabaseConfiguration.getServerAddresses(addressIndex)); if (staticAddresses.empty()) staticAddresses = staticDatabaseConfiguration.getDefaultServerAddresses(); @@ -59,14 +59,16 @@ std::shared_ptr AsyncDatabaseDiscovery::create(std::shar { #if HAVE_HIREDIS if (staticDbType == DatabaseConfiguration::DbType::REDIS_SENTINEL || - staticDbType == DatabaseConfiguration::DbType::SDL_CLUSTER) + staticDbType == DatabaseConfiguration::DbType::SDL_SENTINEL_CLUSTER) { auto sentinelAddress(staticDatabaseConfiguration.getSentinelAddress(addressIndex)); + auto sentinelMasterName(staticDatabaseConfiguration.getSentinelMasterName(addressIndex)); + if (sentinelAddress) return std::make_shared(engine, logger, *sentinelAddress, - staticDatabaseConfiguration.getSentinelMasterName()); + sentinelMasterName); else SHAREDDATALAYER_ABORT("Sentinel address not configured."); }