Fix polarity issue in async rehash

Former-commit-id: dfea168499f0b7829607faec49c491d5072511bc
This commit is contained in:
John Sully 2021-02-09 02:41:44 +00:00
parent bb733b0aab
commit 6ecabe823f

View File

@ -1836,7 +1836,7 @@ void databasesCron(bool fMainThread) {
serverAssert(serverTL->rehashCtl == nullptr); serverAssert(serverTL->rehashCtl == nullptr);
/* Are we async rehashing? And if so is it time to re-calibrate? */ /* Are we async rehashing? And if so is it time to re-calibrate? */
/* The recalibration limit is a prime number to ensure balancing across threads */ /* The recalibration limit is a prime number to ensure balancing across threads */
if (rehashes_per_ms > 0 && async_rehashes < 131 && cserver.active_defrag_enabled) { if (rehashes_per_ms > 0 && async_rehashes < 131 && !cserver.active_defrag_enabled) {
serverTL->rehashCtl = dictRehashAsyncStart(g_pserver->db[rehash_db].dict, rehashes_per_ms); serverTL->rehashCtl = dictRehashAsyncStart(g_pserver->db[rehash_db].dict, rehashes_per_ms);
++async_rehashes; ++async_rehashes;
} }