From 71f09c5a340392a00c1818fd94ee645bb4c91a18 Mon Sep 17 00:00:00 2001 From: Samarah Date: Tue, 26 Sep 2023 20:36:31 +0000 Subject: rgw: Add `rgw_local_cache_address` yaml config Signed-off-by: Samarah --- src/rgw/rgw_redis_driver.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/rgw/rgw_redis_driver.cc') diff --git a/src/rgw/rgw_redis_driver.cc b/src/rgw/rgw_redis_driver.cc index feca1e8d984..90c52b1846b 100644 --- a/src/rgw/rgw_redis_driver.cc +++ b/src/rgw/rgw_redis_driver.cc @@ -98,15 +98,15 @@ std::vector RedisDriver::list_partitions(const DoutPrefixProvider* dp int RedisDriver::initialize(CephContext* cct, const DoutPrefixProvider* dpp) { - this->cct = cct; - if (partition_info.location.back() != '/') { partition_info.location += "/"; } + std::string address = cct->_conf->rgw_local_cache_address; + config cfg; - cfg.addr.host = cct->_conf->rgw_d4n_host; // TODO: Replace with cache address - cfg.addr.port = std::to_string(cct->_conf->rgw_d4n_port); + cfg.addr.host = address.substr(0, address.find(":")); + cfg.addr.port = address.substr(address.find(":") + 1, address.length()); if (!cfg.addr.host.length() || !cfg.addr.port.length()) { ldpp_dout(dpp, 10) << "RGW Redis Cache: Redis cache endpoint was not configured correctly" << dendl; -- cgit v1.2.3