X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/11aaf523131d4f3aa4507043f46984854505bc28..d47ded66ce3c36eb41f38a20ebb5633dfa2e77b0:/src/redis.c diff --git a/src/redis.c b/src/redis.c index 6b92018d..3289ec1e 100644 --- a/src/redis.c +++ b/src/redis.c @@ -29,6 +29,7 @@ #include "redis.h" #include "slowlog.h" +#include "bio.h" #ifdef HAVE_BACKTRACE #include @@ -575,6 +576,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) { * in objects at every object access, and accuracy is not needed. * To access a global var is faster than calling time(NULL) */ server.unixtime = time(NULL); + /* We have just 22 bits per object for LRU information. * So we use an (eventually wrapping) LRU clock with 10 seconds resolution. * 2^22 bits with 10 seconds resoluton is more or less 1.5 years. @@ -707,6 +709,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) { /* Run other sub-systems specific cron jobs */ if (server.cluster_enabled && !(loops % 10)) clusterCron(); +if (!(loops % 10)) bioCreateBackgroundJob(REDIS_BIO_CLOSE_FILE,(void*)1000); server.cronloops++; return 100; } @@ -965,6 +968,7 @@ void initServer() { if (server.cluster_enabled) clusterInit(); scriptingInit(); slowlogInit(); + bioInit(); srand(time(NULL)^getpid()); }