diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-01-18 20:41:30 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-01-18 20:41:30 +0800 |
commit | 2f6cd61ad2f37a680be1a0c19e09ff4fee1af48d (patch) | |
tree | 3e2ab477388d5d391705d821bd5c4dab37a67b73 | |
parent | a2075b5411c81ab4e7c3da79be1d0e6e56ea7f45 (diff) | |
download | lua-language-server-2f6cd61ad2f37a680be1a0c19e09ff4fee1af48d.zip |
filewatch update
-rw-r--r-- | script/service/service.lua | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/script/service/service.lua b/script/service/service.lua index b5e33e25..66143f84 100644 --- a/script/service/service.lua +++ b/script/service/service.lua @@ -13,9 +13,11 @@ local time = require 'bee.time' local fw = require 'filewatch' local furi = require 'file-uri' +---@class service local m = {} m.type = 'service' m.idleClock = 0.0 +m.sleeping = false local function countMemory() local mems = {} @@ -145,6 +147,7 @@ function m.eventLoop() pub.task('timer', 1) pub.on('wakeup', function () m.reportStatus() + fw.update() end) local function busy() @@ -194,23 +197,6 @@ function m.eventLoop() end end -function m.pulse() - --timer.loop(10, function () - -- if not m.workingClock and not m.sleeping and time.monotonic() - m.idleClock >= 300000 then - -- m.sleeping = true - -- files.flushCache() - -- vm.flushCache() - -- ws.flushCache() - -- collectgarbage() - -- collectgarbage() - -- end - -- m.reportStatus() - --end) - timer.loop(1, function () - fw.update() - end) -end - function m.reportStatus() local info = {} if m.workingClock and time.monotonic() - m.workingClock > 100 then @@ -258,7 +244,6 @@ function m.start() pub.recruitBraves(4) proto.listen() m.report() - m.pulse() m.testVersion() require 'provider' |