mirror of
https://github.com/KingDuckZ/kamokan.git
synced 2025-02-17 09:35:49 +00:00
Compose token in c++, not in lua.
This commit is contained in:
parent
1e79a801ba
commit
47ea09ebdf
2 changed files with 3 additions and 4 deletions
|
@ -1,6 +1,4 @@
|
||||||
local token = KEYS[1]
|
local full_token = KEYS[1]
|
||||||
local token_prefix = ARGV[1]
|
|
||||||
local full_token = token_prefix .. token
|
|
||||||
local result = redis.call("HMGET", full_token, "pastie", "selfdes", "lang")
|
local result = redis.call("HMGET", full_token, "pastie", "selfdes", "lang")
|
||||||
if false == result[1] then
|
if false == result[1] then
|
||||||
return redis.error_reply("PastieNotFound")
|
return redis.error_reply("PastieNotFound")
|
||||||
|
|
|
@ -191,7 +191,8 @@ namespace kamokan {
|
||||||
|
|
||||||
redis::Script retrieve = m_redis->command().make_script(string_view(g_load_script, g_load_script_size));
|
redis::Script retrieve = m_redis->command().make_script(string_view(g_load_script, g_load_script_size));
|
||||||
auto batch = m_redis->command().make_batch();
|
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();
|
auto raw_replies = batch.replies();
|
||||||
if (raw_replies.empty())
|
if (raw_replies.empty())
|
||||||
return retval;
|
return retval;
|
||||||
|
|
Loading…
Add table
Reference in a new issue