Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
9a0dbbb5
Commit
9a0dbbb5
authored
Apr 09, 2018
by
antirez
Browse files
Modules: remove trailing empty spaces.
parent
eaafea48
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/module.c
View file @
9a0dbbb5
...
...
@@ -1301,51 +1301,51 @@ int RM_GetSelectedDb(RedisModuleCtx *ctx) {
}
/* Return the current context's flags. The flags provide information on the
/* Return the current context's flags. The flags provide information on the
* current request context (whether the client is a Lua script or in a MULTI),
* and about the Redis instance in general, i.e replication and persistence.
*
* and about the Redis instance in general, i.e replication and persistence.
*
* The available flags are:
*
*
* * REDISMODULE_CTX_FLAGS_LUA: The command is running in a Lua script
*
*
* * REDISMODULE_CTX_FLAGS_MULTI: The command is running inside a transaction
*
*
* * REDISMODULE_CTX_FLAGS_MASTER: The Redis instance is a master
*
*
* * REDISMODULE_CTX_FLAGS_SLAVE: The Redis instance is a slave
*
*
* * REDISMODULE_CTX_FLAGS_READONLY: The Redis instance is read-only
*
*
* * REDISMODULE_CTX_FLAGS_CLUSTER: The Redis instance is in cluster mode
*
*
* * REDISMODULE_CTX_FLAGS_AOF: The Redis instance has AOF enabled
*
*
* * REDISMODULE_CTX_FLAGS_RDB: The instance has RDB enabled
*
*
* * REDISMODULE_CTX_FLAGS_MAXMEMORY: The instance has Maxmemory set
*
*
* * REDISMODULE_CTX_FLAGS_EVICT: Maxmemory is set and has an eviction
* policy that may delete keys
*/
int
RM_GetContextFlags
(
RedisModuleCtx
*
ctx
)
{
int
flags
=
0
;
/* Client specific flags */
if
(
ctx
->
client
)
{
if
(
ctx
->
client
->
flags
&
CLIENT_LUA
)
if
(
ctx
->
client
->
flags
&
CLIENT_LUA
)
flags
|=
REDISMODULE_CTX_FLAGS_LUA
;
if
(
ctx
->
client
->
flags
&
CLIENT_MULTI
)
if
(
ctx
->
client
->
flags
&
CLIENT_MULTI
)
flags
|=
REDISMODULE_CTX_FLAGS_MULTI
;
}
if
(
server
.
cluster_enabled
)
flags
|=
REDISMODULE_CTX_FLAGS_CLUSTER
;
/* Maxmemory and eviction policy */
if
(
server
.
maxmemory
>
0
)
{
flags
|=
REDISMODULE_CTX_FLAGS_MAXMEMORY
;
if
(
server
.
maxmemory_policy
!=
MAXMEMORY_NO_EVICTION
)
flags
|=
REDISMODULE_CTX_FLAGS_EVICT
;
}
...
...
@@ -1364,7 +1364,7 @@ int RM_GetContextFlags(RedisModuleCtx *ctx) {
if
(
server
.
repl_slave_ro
)
flags
|=
REDISMODULE_CTX_FLAGS_READONLY
;
}
return
flags
;
}
...
...
src/redismodule.h
View file @
9a0dbbb5
...
...
@@ -79,7 +79,7 @@
/* The instance has Maxmemory set */
#define REDISMODULE_CTX_FLAGS_MAXMEMORY 0x0100
/* Maxmemory is set and has an eviction policy that may delete keys */
#define REDISMODULE_CTX_FLAGS_EVICT 0x0200
#define REDISMODULE_CTX_FLAGS_EVICT 0x0200
#define REDISMODULE_NOTIFY_GENERIC (1<<2)
/* g */
...
...
@@ -90,7 +90,7 @@
#define REDISMODULE_NOTIFY_ZSET (1<<7)
/* z */
#define REDISMODULE_NOTIFY_EXPIRED (1<<8)
/* x */
#define REDISMODULE_NOTIFY_EVICTED (1<<9)
/* e */
#define REDISMODULE_NOTIFY_STREAM (1<<10)
/* t */
#define REDISMODULE_NOTIFY_STREAM (1<<10)
/* t */
#define REDISMODULE_NOTIFY_ALL (REDISMODULE_NOTIFY_GENERIC | REDISMODULE_NOTIFY_STRING | REDISMODULE_NOTIFY_LIST | REDISMODULE_NOTIFY_SET | REDISMODULE_NOTIFY_HASH | REDISMODULE_NOTIFY_ZSET | REDISMODULE_NOTIFY_EXPIRED | REDISMODULE_NOTIFY_EVICTED | REDISMODULE_NOTIFY_STREAM)
/* A */
...
...
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