diff options
| author | Redbeanw44602 <[email protected]> | 2025-10-27 16:56:39 +0800 |
|---|---|---|
| committer | Redbeanw44602 <[email protected]> | 2025-10-27 16:56:39 +0800 |
| commit | 4dade56c47f64fbf089b1b4299ae284b4e2dd5eb (patch) | |
| tree | 5668844bb51722655c33caa2be2b301526ec66a0 | |
| parent | 64d61226cb275c214aa7160f1a1947e722be0ec0 (diff) | |
add opt.nocache to find_programver.
| -rw-r--r-- | xmake/core/sandbox/modules/import/lib/detect/find_programver.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/xmake/core/sandbox/modules/import/lib/detect/find_programver.lua b/xmake/core/sandbox/modules/import/lib/detect/find_programver.lua index 0d76526e5..dc260e5cc 100644 --- a/xmake/core/sandbox/modules/import/lib/detect/find_programver.lua +++ b/xmake/core/sandbox/modules/import/lib/detect/find_programver.lua @@ -67,7 +67,7 @@ function sandbox_lib_detect_find_programver.main(program, opt) scheduler.co_lock(lockname) -- attempt to get result from cache first - local result = detectcache:get2(cachekey, program) + local result = opt.nocache and nil or detectcache:get2(cachekey, program) if result ~= nil and not opt.force then scheduler.co_unlock(lockname) return result and result or nil @@ -108,7 +108,9 @@ function sandbox_lib_detect_find_programver.main(program, opt) end -- save result - detectcache:set2(cachekey, program, result and result or false) + if not opt.nocache then + detectcache:set2(cachekey, program, result and result or false) + end scheduler.co_unlock(lockname) return result end |
