mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
fix: fix script body access (#1169)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
This commit is contained in:
parent
89072228e5
commit
c2af5b0de1
2 changed files with 5 additions and 4 deletions
|
@ -268,8 +268,9 @@ vector<pair<string, ScriptMgr::ScriptData>> ScriptMgr::GetAll() const {
|
|||
lock_guard lk{mu_};
|
||||
res.reserve(db_.size());
|
||||
for (const auto& [sha, data] : db_) {
|
||||
res.emplace_back(string{sha.data(), sha.size()},
|
||||
ScriptData{data, data.body.get(), data.orig_body.get()});
|
||||
string body = data.body ? string{data.body.get()} : string{};
|
||||
string orig_body = data.orig_body ? string{data.orig_body.get()} : string{};
|
||||
res.emplace_back(string{sha.data(), sha.size()}, ScriptData{data, move(body), move(orig_body)});
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
|
@ -31,8 +31,8 @@ class ScriptMgr {
|
|||
};
|
||||
|
||||
struct ScriptData : public ScriptParams {
|
||||
std::string body;
|
||||
std::string orig_body;
|
||||
std::string body; // script source code present in lua interpreter
|
||||
std::string orig_body; // original code, before removing header and adding async
|
||||
};
|
||||
|
||||
struct ScriptKey : public std::array<char, 40> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue