mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
Merge pull request #5153 from trevor211/fixLuaScript
Consider aof write error as well as rdb in lua script.
This commit is contained in:
commit
ac3c012a7f
@ -493,11 +493,21 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) {
|
|||||||
{
|
{
|
||||||
luaPushError(lua, shared.roslaveerr->ptr);
|
luaPushError(lua, shared.roslaveerr->ptr);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
} else if (server.stop_writes_on_bgsave_err &&
|
} else if ((server.stop_writes_on_bgsave_err &&
|
||||||
server.saveparamslen > 0 &&
|
server.saveparamslen > 0 &&
|
||||||
server.lastbgsave_status == C_ERR)
|
server.lastbgsave_status == C_ERR) ||
|
||||||
|
(server.aof_state != AOF_OFF &&
|
||||||
|
server.aof_last_write_status == C_ERR))
|
||||||
{
|
{
|
||||||
luaPushError(lua, shared.bgsaveerr->ptr);
|
if (server.aof_last_write_status == C_OK) {
|
||||||
|
luaPushError(lua, shared.bgsaveerr->ptr);
|
||||||
|
} else {
|
||||||
|
sds aof_write_err = sdscatfmt(sdsempty(),
|
||||||
|
"-MISCONF Errors writing to the AOF file: %s\r\n",
|
||||||
|
strerror(server.aof_last_write_errno));
|
||||||
|
luaPushError(lua, aof_write_err);
|
||||||
|
sdsfree(aof_write_err);
|
||||||
|
}
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user