mirror of https://github.com/redis/redis.git
				
				
				
			Extend REDISMODULE_CTX_FLAGS to indicate if redis is currently loading from either RDB or AOF
This commit is contained in:
		
							parent
							
								
									0cabe0cfa7
								
							
						
					
					
						commit
						f54d95e803
					
				| 
						 | 
					@ -1455,6 +1455,9 @@ int RM_GetContextFlags(RedisModuleCtx *ctx) {
 | 
				
			||||||
    if (server.cluster_enabled)
 | 
					    if (server.cluster_enabled)
 | 
				
			||||||
        flags |= REDISMODULE_CTX_FLAGS_CLUSTER;
 | 
					        flags |= REDISMODULE_CTX_FLAGS_CLUSTER;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (server.loading)
 | 
				
			||||||
 | 
					        flags |= REDISMODULE_CTX_FLAGS_LOADING;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* Maxmemory and eviction policy */
 | 
					    /* Maxmemory and eviction policy */
 | 
				
			||||||
    if (server.maxmemory > 0) {
 | 
					    if (server.maxmemory > 0) {
 | 
				
			||||||
        flags |= REDISMODULE_CTX_FLAGS_MAXMEMORY;
 | 
					        flags |= REDISMODULE_CTX_FLAGS_MAXMEMORY;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -87,6 +87,8 @@
 | 
				
			||||||
#define REDISMODULE_CTX_FLAGS_OOM_WARNING (1<<11)
 | 
					#define REDISMODULE_CTX_FLAGS_OOM_WARNING (1<<11)
 | 
				
			||||||
/* The command was sent over the replication link. */
 | 
					/* The command was sent over the replication link. */
 | 
				
			||||||
#define REDISMODULE_CTX_FLAGS_REPLICATED (1<<12)
 | 
					#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 */
 | 
					#define REDISMODULE_NOTIFY_GENERIC (1<<2)     /* g */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue