mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
activeExpireCycle(): fix about fast cycle early start.
We don't want to repeat a fast cycle too soon, the previous code was broken, we need to wait two times the period *since* the start of the previous cycle in order to avoid there is an even space between cycles: .-> start .-> second start | | +-------------+-------------+--------------+ | first cycle | pause | second cycle | +-------------+-------------+--------------+ The second and first start must be PERIOD*2 useconds apart hence the *2 in the new code.
This commit is contained in:
parent
6500fabfb8
commit
4befe73b60
@ -721,7 +721,7 @@ void activeExpireCycle(int type) {
|
|||||||
* for time limt. Also don't repeat a fast cycle for the same period
|
* for time limt. Also don't repeat a fast cycle for the same period
|
||||||
* as the fast cycle total duration itself. */
|
* as the fast cycle total duration itself. */
|
||||||
if (!timelimit_exit) return;
|
if (!timelimit_exit) return;
|
||||||
if (start < last_fast_cycle + ACTIVE_EXPIRE_CYCLE_FAST_DURATION) return;
|
if (start < last_fast_cycle + ACTIVE_EXPIRE_CYCLE_FAST_DURATION*2) return;
|
||||||
last_fast_cycle = start;
|
last_fast_cycle = start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user