Don't run code in evict unless we really have to

Former-commit-id: b665b1c2b2df96883a6e2237f7bf3f9b1bec2a89
This commit is contained in:
John Sully 2021-03-24 20:13:42 +00:00
parent fa244c930e
commit 54fb01e24a

View File

@ -587,7 +587,7 @@ int freeMemoryIfNeeded(bool fQuickCycle, bool fPreSnapshot) {
/* volatile-random and allkeys-random policy */
if (g_pserver->maxmemory_policy == MAXMEMORY_ALLKEYS_RANDOM ||
g_pserver->maxmemory_policy == MAXMEMORY_VOLATILE_RANDOM
|| fEvictToStorage)
|| fFallback)
{
/* When evicting a random key, we try to evict a key for
* each DB, so we use the static 'next_db' variable to