From 8f8b61f21110dff0dcce6ecd9601dc54c1e1ffcc Mon Sep 17 00:00:00 2001 From: Malavan Sotheeswaran Date: Tue, 22 Aug 2023 13:18:14 -0700 Subject: [PATCH] compile fix --- src/StorageCache.cpp | 8 ++++---- src/expire.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/StorageCache.cpp b/src/StorageCache.cpp index a955f8ed5..ba7910399 100644 --- a/src/StorageCache.cpp +++ b/src/StorageCache.cpp @@ -85,8 +85,8 @@ void StorageCache::cacheKey(const char *rgch, size_t cch) bool StorageCache::erase(sds key) { unsigned long long when = 0; - m_spstorage->retrieve(key, sdslen(key), [&when, &key](const char *, size_t, const void * data, size_t cbdata) { - auto e = deserializeExpire(key, (const char *)data, cbdata, nullptr); + m_spstorage->retrieve(key, sdslen(key), [&when](const char *, size_t, const void * data, size_t cbdata) { + auto e = deserializeExpire((const char *)data, cbdata, nullptr); if (e != nullptr) when = e->when(); }); @@ -123,7 +123,7 @@ void StorageCache::insert(sds key, const void *data, size_t cbdata, bool fOverwr } ul.unlock(); m_spstorage->insert(key, sdslen(key), (void*)data, cbdata, fOverwrite); - auto e = deserializeExpire(key, (const char *)data, cbdata, nullptr); + auto e = deserializeExpire((const char *)data, cbdata, nullptr); if (e != nullptr) m_spstorage->setExpire(key, sdslen(key), e->when()); } @@ -143,7 +143,7 @@ void StorageCache::bulkInsert(char **rgkeys, size_t *rgcbkeys, char **rgvals, si de->v.u64 = 1; vechashes.push_back(de); } - auto e = deserializeExpire(rgkeys[ielem], rgvals[ielem], rgcbvals[ielem], nullptr); + auto e = deserializeExpire(rgvals[ielem], rgcbvals[ielem], nullptr); if (e != nullptr) m_spstorage->setExpire(rgkeys[ielem], rgcbkeys[ielem], e->when()); } diff --git a/src/expire.cpp b/src/expire.cpp index 99879950f..2532a7563 100644 --- a/src/expire.cpp +++ b/src/expire.cpp @@ -334,7 +334,7 @@ void pexpireMemberAtCommand(client *c) static int timelimit_exit = 0; /* Time limit hit in previous call? */ static long long last_fast_cycle = 0; /* When last fast cycle ran. */ - int j; + int j, iteration; int dbs_per_call = CRON_DBS_PER_CALL; long long start = ustime(), timelimit, elapsed; @@ -518,6 +518,8 @@ void pexpireMemberAtCommand(client *c) } while (sampled == 0 || (expired*100/sampled) > config_cycle_acceptable_stale); } else { + long long now; + size_t tried = 0; std::vector keys; do { keys = db->getStorageCache()->getExpirationCandidates(ACTIVE_EXPIRE_CYCLE_LOOKUPS_PER_LOOP, now); @@ -526,7 +528,7 @@ void pexpireMemberAtCommand(client *c) db->find(szFromObj(keyobj)); expireEntry *e = db->getExpire(keyobj); if (e != nullptr && e->when() < now) - total_expired += activeExpireCycleExpire(db, *e, now, tried); + total_expired += activeExpireCycleExpire(db, szFromObj(keyobj), *e, now, tried); decrRefCount(keyobj); } total_sampled += keys.size();