Skip to content

Commit 5513712

Browse files
committed
test clear node cache
#1626
1 parent d94e046 commit 5513712

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

script/provider/provider.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,7 @@ m.register '$/status/click' {
10721072
local result = client.awaitRequestMessage('Info', lang.script.WINDOW_LUA_STATUS_DIAGNOSIS_MSG, {
10731073
titleDiagnostic,
10741074
DEVELOP and 'Restart Server',
1075+
DEVELOP and 'Clear Node Cache',
10751076
})
10761077
if not result then
10771078
return
@@ -1085,6 +1086,11 @@ m.register '$/status/click' {
10851086
local diag = require 'provider.diagnostic'
10861087
diag.clearAll(true)
10871088
os.exit(0, true)
1089+
elseif result == 'Clear Node Cache' then
1090+
local vm = require 'vm'
1091+
vm.clearNodeCache()
1092+
collectgarbage()
1093+
collectgarbage()
10881094
end
10891095
end
10901096
}

0 commit comments

Comments
 (0)