From 2f6cd61ad2f37a680be1a0c19e09ff4fee1af48d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 18 Jan 2022 20:41:30 +0800 Subject: filewatch update --- script/service/service.lua | 21 +++------------------ 1 file 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' -- cgit v1.2.3