fix(v8): v8 code cache file broken protect

This commit is contained in:
etkmao
2023-10-27 15:06:50 +08:00
committed by zealotchen
parent bf266b9346
commit f9b468e406
+4 -2
View File
@@ -351,8 +351,10 @@ bool RunScriptInternal(const std::shared_ptr<Runtime>& runtime,
if (!read_script_flag || StringViewUtils::IsEmpty(script_content)) {
TDF_BASE_LOG(WARNING) << "read_script_flag = " << read_script_flag
<< ", script content empty, uri = " << uri;
std::lock_guard<std::mutex> lock(code_cache_file_mutex);
CheckUseCodeCacheAfterRunScript(code_cache_path);
if (is_use_code_cache) {
std::lock_guard<std::mutex> lock(code_cache_file_mutex);
CheckUseCodeCacheAfterRunScript(code_cache_path);
}
return false;
}