Permalink
Browse files

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.
  • Loading branch information...
1 parent c24030c commit f24eee937d01ca2f81a91dfbb9fe03f2739f8ad2 @antirez committed May 6, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/scripting.c
View
@@ -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);
}
}

0 comments on commit f24eee9

Please sign in to comment.