redis.replicate_commands() * * Turn on single commands replication if the script never called * a write command so far, and returns true. Otherwise if the script * already started to write, returns false and stick to whole scripts * replication, which is our default. */
| 926 | * already started to write, returns false and stick to whole scripts |
| 927 | * replication, which is our default. */ |
| 928 | int luaRedisReplicateCommandsCommand(lua_State *lua) { |
| 929 | if (g_pserver->lua_write_dirty) { |
| 930 | lua_pushboolean(lua,0); |
| 931 | } else { |
| 932 | g_pserver->lua_replicate_commands = 1; |
| 933 | /* When we switch to single commands replication, we can provide |
| 934 | * different math.random() sequences at every call, which is what |
| 935 | * the user normally expects. */ |
| 936 | redisSrand48(rand()); |
| 937 | lua_pushboolean(lua,1); |
| 938 | } |
| 939 | return 1; |
| 940 | } |
| 941 | |
| 942 | /* redis.breakpoint() |
| 943 | * |
nothing calls this directly
no test coverage detected