MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / prepareLuaClient

Function prepareLuaClient

src/scripting.cpp:1511–1520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1509}
1510
1511void prepareLuaClient(void) {
1512 /* Select the right DB in the context of the Lua client */
1513 selectDb(serverTL->lua_client,g_pserver->lua_caller->db->id);
1514 serverTL->lua_client->resp = 2; /* Default is RESP2, scripts can change it. */
1515
1516 /* If we are in MULTI context, flag Lua client as CLIENT_MULTI. */
1517 if (g_pserver->lua_caller->flags & CLIENT_MULTI) {
1518 serverTL->lua_client->flags |= CLIENT_MULTI;
1519 }
1520}
1521
1522void resetLuaClient(void) {
1523 /* After the script done, remove the MULTI state. */

Callers 1

evalGenericCommandFunction · 0.85

Calls 1

selectDbFunction · 0.85

Tested by

no test coverage detected