diff options
Diffstat (limited to 'src/scripting.c')
-rw-r--r-- | src/scripting.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/scripting.c b/src/scripting.c index 9282b7fd9..5ed24ffad 100644 --- a/src/scripting.c +++ b/src/scripting.c @@ -655,12 +655,11 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) { !server.loading && /* Don't care about mem if loading. */ !server.masterhost && /* Slave must execute the script. */ server.lua_write_dirty == 0 && /* Script had no side effects so far. */ + server.lua_oom && /* Detected OOM when script start. */ (cmd->flags & CMD_DENYOOM)) { - if (getMaxmemoryState(NULL,NULL,NULL,NULL) != C_OK) { - luaPushError(lua, shared.oomerr->ptr); - goto cleanup; - } + luaPushError(lua, shared.oomerr->ptr); + goto cleanup; } if (cmd->flags & CMD_RANDOM) server.lua_random_dirty = 1; |