diff options
| author | ruki <[email protected]> | 2020-12-22 00:48:16 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-12-22 00:48:16 +0800 |
| commit | 4782a9648e20c0e6a4620f7255ab3cb476dceb5e (patch) | |
| tree | b28369f767800262db24da6b347d62acf8ffad33 /xmake/core/cache/localcache.lua | |
| parent | 192f10c1d09e665f04dd5669fcaccc5abccbb9db (diff) | |
rewrite some caches
Diffstat (limited to 'xmake/core/cache/localcache.lua')
| -rw-r--r-- | xmake/core/cache/localcache.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/xmake/core/cache/localcache.lua b/xmake/core/cache/localcache.lua index 7ba00e7cc..3fd5d040f 100644 --- a/xmake/core/cache/localcache.lua +++ b/xmake/core/cache/localcache.lua @@ -172,6 +172,20 @@ function localcache.set3(cachename, key1, key2, key3, value) return localcache.cache(cachename):set3(key1, key2, key3, value) end +-- save the given cache, it will save all caches if cache name is nil +function localcache.save(cachename) + if cachename then + localcache.cache(cachename):save() + else + local caches = localcache.caches() + if caches then + for _, cache in pairs(caches) do + cache:save() + end + end + end +end + -- clear the given cache, it will clear all caches if cache name is nil function localcache.clear(cachename) if cachename then |
