1
0
Fork 0
mirror of https://github.com/KingDuckZ/kamokan.git synced 2024-11-23 00:33:44 +00:00

Compose token in c++, not in lua.

This commit is contained in:
King_DuckZ 2017-08-07 10:15:30 +01:00
parent 1e79a801ba
commit 47ea09ebdf
2 changed files with 3 additions and 4 deletions

View file

@ -1,6 +1,4 @@
local token = KEYS[1]
local token_prefix = ARGV[1]
local full_token = token_prefix .. token
local full_token = KEYS[1]
local result = redis.call("HMGET", full_token, "pastie", "selfdes", "lang")
if false == result[1] then
return redis.error_reply("PastieNotFound")

View file

@ -191,7 +191,8 @@ namespace kamokan {
redis::Script retrieve = m_redis->command().make_script(string_view(g_load_script, g_load_script_size));
auto batch = m_redis->command().make_batch();
retrieve.run(batch, std::make_tuple(parToken), std::make_tuple(string_view(g_token_prefix)));
std::string token_with_prefix = std::string(g_token_prefix) + std::string(parToken);
retrieve.run(batch, std::make_tuple(token_with_prefix), std::tuple<>());
auto raw_replies = batch.replies();
if (raw_replies.empty())
return retval;