mirror of https://github.com/redis/redis.git
Simplify a redundant condition in computeDefragCycles (#9076)
Co-authored-by: lizhaolong.lzl <lizhaolong.lzl@B-54MPMD6R-0221.local>
This commit is contained in:
parent
688cdb05b4
commit
dee378d76d
|
@ -1060,9 +1060,7 @@ void computeDefragCycles() {
|
||||||
server.active_defrag_cycle_max);
|
server.active_defrag_cycle_max);
|
||||||
/* We allow increasing the aggressiveness during a scan, but don't
|
/* We allow increasing the aggressiveness during a scan, but don't
|
||||||
* reduce it. */
|
* reduce it. */
|
||||||
if (!server.active_defrag_running ||
|
if (cpu_pct > server.active_defrag_running) {
|
||||||
cpu_pct > server.active_defrag_running)
|
|
||||||
{
|
|
||||||
server.active_defrag_running = cpu_pct;
|
server.active_defrag_running = cpu_pct;
|
||||||
serverLog(LL_VERBOSE,
|
serverLog(LL_VERBOSE,
|
||||||
"Starting active defrag, frag=%.0f%%, frag_bytes=%zu, cpu=%d%%",
|
"Starting active defrag, frag=%.0f%%, frag_bytes=%zu, cpu=%d%%",
|
||||||
|
|
Loading…
Reference in New Issue