feat: do not process lua script if sha exists in cache (#1537)

This commit is contained in:
Kostas Kyrimis 2023-07-12 19:31:42 +03:00 committed by GitHub
parent 7d3766a197
commit 0f8f6f387b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -216,6 +216,10 @@ io::Result<string, GenericError> ScriptMgr::Insert(string_view body, Interpreter
Interpreter::FuncSha1(body, sha_buf);
string_view sha{sha_buf, std::strlen(sha_buf)};
if (interpreter->Exists(sha)) {
return string{sha};
}
string_view orig_body = body;
auto params_opt = DeduceParams(&body);