summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2011-05-06 17:30:54 +0200
committerantirez <antirez@gmail.com>2011-05-11 10:51:27 +0200
commitf24eee937d01ca2f81a91dfbb9fe03f2739f8ad2 (patch)
tree7b8ff64e3f144ea3c2a970700f340c6d2b0b0685
parentc24030c63c62fdca1a9fc5c189dcc96e86e17b6b (diff)
downloadredis-f24eee937d01ca2f81a91dfbb9fe03f2739f8ad2.tar.gz
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.
-rw-r--r--src/scripting.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scripting.c b/src/scripting.c
index 58371808a..dbca88087 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);
}
}