summaryrefslogtreecommitdiff
path: root/src/script.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/script.h')
-rw-r--r--src/script.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/script.h b/src/script.h
index b2e253ee0..122db1dcf 100644
--- a/src/script.h
+++ b/src/script.h
@@ -62,6 +62,7 @@
#define SCRIPT_TIMEDOUT (1ULL<<3) /* indicate that the current script timedout */
#define SCRIPT_KILLED (1ULL<<4) /* indicate that the current script was marked to be killed */
#define SCRIPT_READ_ONLY (1ULL<<5) /* indicate that the current script should only perform read commands */
+#define SCRIPT_ALLOW_OOM (1ULL<<6) /* indicate to allow any command even if OOM reached */
#define SCRIPT_EVAL_MODE (1ULL<<7) /* Indicate that the current script called from legacy Lua */
typedef struct scriptRunCtx scriptRunCtx;
@@ -75,6 +76,20 @@ struct scriptRunCtx {
mstime_t snapshot_time;
};
+/* Scripts flags */
+#define SCRIPT_FLAG_NO_WRITES (1ULL<<0)
+#define SCRIPT_FLAG_ALLOW_OOM (1ULL<<1)
+#define SCRIPT_FLAG_ALLOW_STALE (1ULL<<3)
+#define SCRIPT_FLAG_NO_CLUSTER (1ULL<<4)
+
+/* Defines a script flags */
+typedef struct scriptFlag {
+ uint64_t flag;
+ const char *str;
+} scriptFlag;
+
+extern scriptFlag scripts_flags_def[];
+
void scriptPrepareForRun(scriptRunCtx *r_ctx, client *engine_client, client *caller, const char *funcname);
void scriptResetRun(scriptRunCtx *r_ctx);
int scriptSetResp(scriptRunCtx *r_ctx, int resp);