summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2019-07-07 17:01:29 +0200
committerGitHub <noreply@github.com>2019-07-07 17:01:29 +0200
commit677e95e2f5ee903682ce44a7bfd9558a22577926 (patch)
tree3cd37964d0b6d7a6dcd7f3f582e8cb7ea72964bf
parenta714004738025aeed957d748997d1be0f8ee1a7f (diff)
parentf54d95e803cb9dc017e1d40e1a0051101d5cb7dd (diff)
downloadredis-677e95e2f5ee903682ce44a7bfd9558a22577926.tar.gz
Merge pull request #6161 from swilly22/redismodule-loading-ctx-flag
Extend REDISMODULE_CTX_FLAGS to indicate if redis is loading
-rw-r--r--src/module.c3
-rw-r--r--src/redismodule.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/src/module.c b/src/module.c
index f06e9e99d..f4f753c00 100644
--- a/src/module.c
+++ b/src/module.c
@@ -1466,6 +1466,9 @@ int RM_GetContextFlags(RedisModuleCtx *ctx) {
if (server.cluster_enabled)
flags |= REDISMODULE_CTX_FLAGS_CLUSTER;
+ if (server.loading)
+ flags |= REDISMODULE_CTX_FLAGS_LOADING;
+
/* Maxmemory and eviction policy */
if (server.maxmemory > 0) {
flags |= REDISMODULE_CTX_FLAGS_MAXMEMORY;
diff --git a/src/redismodule.h b/src/redismodule.h
index 5c7643dee..b9c73957b 100644
--- a/src/redismodule.h
+++ b/src/redismodule.h
@@ -87,6 +87,8 @@
#define REDISMODULE_CTX_FLAGS_OOM_WARNING (1<<11)
/* The command was sent over the replication link. */
#define REDISMODULE_CTX_FLAGS_REPLICATED (1<<12)
+/* Redis is currently loading either from AOF or RDB. */
+#define REDISMODULE_CTX_FLAGS_LOADING (1<<13)
#define REDISMODULE_NOTIFY_GENERIC (1<<2) /* g */