mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Avoid division by zero issues in the automatically triggered AOF rewrite feature.
This commit is contained in:
parent
e087b6d7a1
commit
e3d27a7261
@ -695,8 +695,9 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
|
|||||||
if (server.auto_aofrewrite_perc &&
|
if (server.auto_aofrewrite_perc &&
|
||||||
server.appendonly_current_size > server.auto_aofrewrite_min_size)
|
server.appendonly_current_size > server.auto_aofrewrite_min_size)
|
||||||
{
|
{
|
||||||
int growth = (server.appendonly_current_size*100/
|
int base = server.auto_aofrewrite_base_size ?
|
||||||
server.auto_aofrewrite_base_size);
|
server.auto_aofrewrite_base_size : 1;
|
||||||
|
int growth = (server.appendonly_current_size*100/base);
|
||||||
if (growth >= server.auto_aofrewrite_perc) {
|
if (growth >= server.auto_aofrewrite_perc) {
|
||||||
redisLog(REDIS_NOTICE,"Starting automatic rewriting of AOF on %d growth",growth);
|
redisLog(REDIS_NOTICE,"Starting automatic rewriting of AOF on %d growth",growth);
|
||||||
rewriteAppendOnlyFileBackground();
|
rewriteAppendOnlyFileBackground();
|
||||||
|
Loading…
Reference in New Issue
Block a user