From: antirez Date: Fri, 6 May 2011 15:30:54 +0000 (+0200) Subject: Lua max exec time fixes: redisLog() to log the event moved before the lua_error(... X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/87c219243c42b826da98cb8ad832785a5f569dca Lua max exec time fixes: redisLog() to log the event moved before the lua_error() call that does a long jump so never returns. Aesthetic fixes in error message. --- diff --git a/src/scripting.c b/src/scripting.c index 7d222651..35b41a87 100644 --- a/src/scripting.c +++ b/src/scripting.c @@ -206,9 +206,9 @@ void luaMaskCountHook(lua_State *lua, lua_Debug *ar) { if (server.lua_time_limit <= 0) return; elapsed = (ustime()/1000) - server.lua_time_start; if (elapsed >= server.lua_time_limit) { - lua_pushstring(lua,"Script aborted for max execution time..."); + redisLog(REDIS_NOTICE,"Lua script aborted for max execution time after %lld milliseconds of running time.",elapsed); + lua_pushstring(lua,"Script aborted for max execution time."); lua_error(lua); - redisLog(REDIS_NOTICE,"Lua script aborted for max execution time after %lld milliseconds of running time",elapsed); } }