From fc731bc67f8ecd07e83aa138b03a073028f9f3f2 Mon Sep 17 00:00:00 2001 From: "meir@redislabs.com" Date: Tue, 5 Oct 2021 19:37:03 +0300 Subject: 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. --- src/evict.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/evict.c') 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 /* ---------------------------------------------------------------------------- @@ -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. */ -- cgit v1.2.1