Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
26e98da2
Commit
26e98da2
authored
Mar 11, 2019
by
swilly22
Committed by
antirez
Mar 13, 2019
Browse files
Extend REDISMODULE_CTX_FLAGS to indicate if command was sent by master
parent
67452e91
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/module.c
View file @
26e98da2
...
@@ -1390,6 +1390,9 @@ int RM_GetContextFlags(RedisModuleCtx *ctx) {
...
@@ -1390,6 +1390,9 @@ int RM_GetContextFlags(RedisModuleCtx *ctx) {
flags
|=
REDISMODULE_CTX_FLAGS_LUA
;
flags
|=
REDISMODULE_CTX_FLAGS_LUA
;
if
(
ctx
->
client
->
flags
&
CLIENT_MULTI
)
if
(
ctx
->
client
->
flags
&
CLIENT_MULTI
)
flags
|=
REDISMODULE_CTX_FLAGS_MULTI
;
flags
|=
REDISMODULE_CTX_FLAGS_MULTI
;
/* Module command recieved from MASTER, is replicated. */
if
(
ctx
->
client
->
flags
&
CLIENT_MASTER
)
flags
|=
REDISMODULE_CTX_FLAGS_REPLICATED
;
}
}
if
(
server
.
cluster_enabled
)
if
(
server
.
cluster_enabled
)
...
...
src/redismodule.h
View file @
26e98da2
...
@@ -85,6 +85,9 @@
...
@@ -85,6 +85,9 @@
#define REDISMODULE_CTX_FLAGS_OOM (1<<10)
#define REDISMODULE_CTX_FLAGS_OOM (1<<10)
/* Less than 25% of memory available according to maxmemory. */
/* Less than 25% of memory available according to maxmemory. */
#define REDISMODULE_CTX_FLAGS_OOM_WARNING (1<<11)
#define REDISMODULE_CTX_FLAGS_OOM_WARNING (1<<11)
/* The command was sent over the replication link. */
#define REDISMODULE_CTX_FLAGS_REPLICATED (1<<12)
#define REDISMODULE_NOTIFY_GENERIC (1<<2)
/* g */
#define REDISMODULE_NOTIFY_GENERIC (1<<2)
/* g */
#define REDISMODULE_NOTIFY_STRING (1<<3)
/* $ */
#define REDISMODULE_NOTIFY_STRING (1<<3)
/* $ */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment