summaryrefslogtreecommitdiff
path: root/src/evict.c
diff options
context:
space:
mode:
authormeir@redislabs.com <meir@redislabs.com>2021-10-05 19:37:03 +0300
committermeir <meir@redis.com>2021-12-01 23:54:23 +0200
commitfc731bc67f8ecd07e83aa138b03a073028f9f3f2 (patch)
tree6ce3c60a82905186fea6ceb470e5ae28e2588bd6 /src/evict.c
parente0cd580aefe13e49df802fec5135e4f22d46e758 (diff)
downloadredis-fc731bc67f8ecd07e83aa138b03a073028f9f3f2.tar.gz
Redis Functions - Introduce script unit.
Script unit is a new unit located on script.c. Its purpose is to provides an API for functions (and eval) to interact with Redis. Interaction includes mostly executing commands, but also functionalities like calling Redis back on long scripts or check if the script was killed. The interaction is done using a scriptRunCtx object that need to be created by the user and initialized using scriptPrepareForRun. Detailed list of functionalities expose by the unit: 1. Calling commands (including all the validation checks such as acl, cluster, read only run, ...) 2. Set Resp 3. Set Replication method (AOF/REPLICATION/NONE) 4. Call Redis back to on long running scripts to allow Redis reply to clients and perform script kill The commit introduce the new unit and uses it on eval commands to interact with Redis.
Diffstat (limited to 'src/evict.c')
-rw-r--r--src/evict.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/evict.c b/src/evict.c
index 2d87546cb..a10c2d20e 100644
--- a/src/evict.c
+++ b/src/evict.c
@@ -33,6 +33,7 @@
#include "server.h"
#include "bio.h"
#include "atomicvar.h"
+#include "script.h"
#include <math.h>
/* ----------------------------------------------------------------------------
@@ -472,7 +473,7 @@ static int evictionTimeProc(
static int isSafeToPerformEvictions(void) {
/* - There must be no script in timeout condition.
* - Nor we are loading data right now. */
- if (server.script_timedout || server.loading) return 0;
+ if (scriptIsTimedout() || server.loading) return 0;
/* By default replicas should ignore maxmemory
* and just be masters exact copies. */