Skip to content

Commit

Permalink
fix reply schema and add fast path to return noscript err
Browse files Browse the repository at this point in the history
Change-Id: Ia756dc5db4ebad5c83b4cc3b7f4a6702f94cfca4
Signed-off-by: wei.kukey <wei.kukey@gmail.com>
  • Loading branch information
kukey committed Jun 13, 2024
1 parent ea81d56 commit 231e80c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/commands/script-dump.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"type": "string"
},
{
"description": "null if sha1 hash does not exist in script cache.",
"type": "null"
"description": "noscript error if sha1 hash does not exist in script cache.",
"const": "NOSCRIPT No matching script."
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ NULL
dictEntry *de;
luaScript *ls;

if ((de = dictFind(lctx.lua_scripts, c->argv[2]->ptr))) {
if (sdslen(c->argv[2]->ptr) == 40 && (de = dictFind(lctx.lua_scripts, c->argv[2]->ptr))) {
ls = dictGetVal(de);
addReplyBulk(c, ls->body);
} else {
Expand Down

0 comments on commit 231e80c

Please sign in to comment.