Lines Matching refs:server
351 client *c = server.lua_client; in luaRedisGenericCommand()
478 if (server.lua_random_dirty && !server.lua_replicate_commands) { in luaRedisGenericCommand()
482 } else if (server.masterhost && server.repl_slave_ro && in luaRedisGenericCommand()
483 !server.loading && in luaRedisGenericCommand()
484 !(server.lua_caller->flags & CLIENT_MASTER)) in luaRedisGenericCommand()
488 } else if (server.stop_writes_on_bgsave_err && in luaRedisGenericCommand()
489 server.saveparamslen > 0 && in luaRedisGenericCommand()
490 server.lastbgsave_status == C_ERR) in luaRedisGenericCommand()
501 if (server.maxmemory && server.lua_write_dirty == 0 && in luaRedisGenericCommand()
510 if (cmd->flags & CMD_RANDOM) server.lua_random_dirty = 1; in luaRedisGenericCommand()
511 if (cmd->flags & CMD_WRITE) server.lua_write_dirty = 1; in luaRedisGenericCommand()
516 if (server.cluster_enabled && !server.loading && in luaRedisGenericCommand()
517 !(server.lua_caller->flags & CLIENT_MASTER)) in luaRedisGenericCommand()
521 c->flags |= server.lua_caller->flags & (CLIENT_READONLY|CLIENT_ASKING); in luaRedisGenericCommand()
523 server.cluster->myself) in luaRedisGenericCommand()
535 if (server.lua_replicate_commands && in luaRedisGenericCommand()
536 !server.lua_multi_emitted && in luaRedisGenericCommand()
537 server.lua_write_dirty && in luaRedisGenericCommand()
538 server.lua_repl != PROPAGATE_NONE) in luaRedisGenericCommand()
540 execCommandPropagateMulti(server.lua_caller); in luaRedisGenericCommand()
541 server.lua_multi_emitted = 1; in luaRedisGenericCommand()
546 if (server.lua_replicate_commands) { in luaRedisGenericCommand()
548 if (server.lua_repl & PROPAGATE_AOF) in luaRedisGenericCommand()
550 if (server.lua_repl & PROPAGATE_REPL) in luaRedisGenericCommand()
585 (server.lua_replicate_commands == 0) && in luaRedisGenericCommand()
699 if (server.lua_write_dirty) { in luaRedisReplicateCommandsCommand()
702 server.lua_replicate_commands = 1; in luaRedisReplicateCommandsCommand()
752 if (server.lua_replicate_commands == 0) { in luaRedisSetReplCommand()
765 server.lua_repl = flags; in luaRedisSetReplCommand()
899 server.lua_client = NULL; in scriptingInit()
900 server.lua_caller = NULL; in scriptingInit()
901 server.lua_timedout = 0; in scriptingInit()
902 server.lua_always_replicate_commands = 0; /* Only DEBUG can change it.*/ in scriptingInit()
903 server.lua_time_limit = LUA_SCRIPT_TIME_LIMIT; in scriptingInit()
913 server.lua_scripts = dictCreate(&shaScriptObjectDictType,NULL); in scriptingInit()
1051 if (server.lua_client == NULL) { in scriptingInit()
1052 server.lua_client = createClient(-1); in scriptingInit()
1053 server.lua_client->flags |= CLIENT_LUA; in scriptingInit()
1061 server.lua = lua; in scriptingInit()
1067 dictRelease(server.lua_scripts); in scriptingRelease()
1068 lua_close(server.lua); in scriptingRelease()
1173 int retval = dictAdd(server.lua_scripts, in luaCreateFunction()
1187 elapsed = mstime() - server.lua_time_start; in luaMaskCountHook()
1188 if (elapsed >= server.lua_time_limit && server.lua_timedout == 0) { in luaMaskCountHook()
1190 server.lua_timedout = 1; in luaMaskCountHook()
1196 aeDeleteFileEvent(server.el, server.lua_caller->fd, AE_READABLE); in luaMaskCountHook()
1198 if (server.lua_timedout) processEventsWhileBlocked(); in luaMaskCountHook()
1199 if (server.lua_kill) { in luaMaskCountHook()
1207 lua_State *lua = server.lua; in evalGenericCommand()
1224 server.lua_random_dirty = 0; in evalGenericCommand()
1225 server.lua_write_dirty = 0; in evalGenericCommand()
1226 server.lua_replicate_commands = server.lua_always_replicate_commands; in evalGenericCommand()
1227 server.lua_multi_emitted = 0; in evalGenericCommand()
1228 server.lua_repl = PROPAGATE_AOF|PROPAGATE_REPL; in evalGenericCommand()
1294 selectDb(server.lua_client,c->db->id); in evalGenericCommand()
1303 server.lua_caller = c; in evalGenericCommand()
1304 server.lua_time_start = mstime(); in evalGenericCommand()
1305 server.lua_kill = 0; in evalGenericCommand()
1306 if (server.lua_time_limit > 0 && server.masterhost == NULL && in evalGenericCommand()
1312 lua_sethook(server.lua,luaLdbLineHook,LUA_MASKLINE|LUA_MASKCOUNT,100000); in evalGenericCommand()
1323 if (server.lua_timedout) { in evalGenericCommand()
1324 server.lua_timedout = 0; in evalGenericCommand()
1327 aeCreateFileEvent(server.el,c->fd,AE_READABLE, in evalGenericCommand()
1330 server.lua_caller = NULL; in evalGenericCommand()
1362 if (server.lua_replicate_commands) { in evalGenericCommand()
1364 if (server.lua_multi_emitted) { in evalGenericCommand()
1367 alsoPropagate(server.execCommand,c->db->id,propargv,1, in evalGenericCommand()
1383 if (evalsha && !server.lua_replicate_commands) { in evalGenericCommand()
1388 robj *script = dictFetchValue(server.lua_scripts,c->argv[1]->ptr); in evalGenericCommand()
1429 server.dirty++; /* Propagating this command is a good idea. */ in scriptCommand()
1435 if (dictFind(server.lua_scripts,c->argv[j]->ptr)) in scriptCommand()
1448 if (dictFind(server.lua_scripts,sha) == NULL) { in scriptCommand()
1449 if (luaCreateFunction(c,server.lua,funcname,c->argv[2]) in scriptCommand()
1459 if (server.lua_caller == NULL) { in scriptCommand()
1461 } else if (server.lua_write_dirty) { in scriptCommand()
1464 server.lua_kill = 1; in scriptCommand()
2171 int j, saved_rc = server.lua_replicate_commands; in ldbRedis()
2179 server.lua_replicate_commands = 1; in ldbRedis()
2182 server.lua_replicate_commands = saved_rc; in ldbRedis()
2356 mstime_t elapsed = mstime() - server.lua_time_start; in luaLdbLineHook()
2357 mstime_t timelimit = server.lua_time_limit ? in luaLdbLineHook()
2358 server.lua_time_limit : 5000; in luaLdbLineHook()
2386 server.lua_time_start = mstime(); in luaLdbLineHook()