/*
- 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.
const boost::optional<std::size_t>& addressIndex,
std::shared_ptr<Logger> logger)
{
- auto staticAddresses(staticDatabaseConfiguration.getServerAddresses());
+ auto staticAddresses(staticDatabaseConfiguration.getServerAddresses(addressIndex));
if (staticAddresses.empty())
staticAddresses = staticDatabaseConfiguration.getDefaultServerAddresses();
{
#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<AsyncSentinelDatabaseDiscovery>(engine,
logger,
*sentinelAddress,
- staticDatabaseConfiguration.getSentinelMasterName());
+ sentinelMasterName);
else
SHAREDDATALAYER_ABORT("Sentinel address not configured.");
}