From 221b378fa69132808a5d396b777866338cbe65a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 24 Jun 2019 12:15:23 +0800 Subject: =?UTF-8?q?=E9=87=8D=E8=BD=BD=E6=89=80=E6=9C=89=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8E=E8=B7=B3=E8=BF=87dead=20value=E7=9A=84=E6=A3=80?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/service.lua | 7 +++---- server/src/task.lua | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'server') diff --git a/server/src/service.lua b/server/src/service.lua index 8ba9cd3b..5ed235c9 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -299,7 +299,6 @@ function mt:reCompile() self.emmy = emmyMgr() self.globalValue = nil self._compileTask:remove() - --self._compileTask = nil self._needCompile = {} local compiled = {} local n = 0 @@ -310,7 +309,7 @@ function mt:reCompile() end end log.debug('reCompile:', n) - self:_testMemory() + self:_testMemory('skip') end function mt:reDiagnostic() @@ -723,7 +722,7 @@ function mt:onUpdateConfig(updated, other) end end -function mt:_testMemory() +function mt:_testMemory(skipDead) local clock = os.clock() collectgarbage() log.debug('collectgarbage: ', ('%.3f'):format(os.clock() - clock)) @@ -841,7 +840,7 @@ function mt:_testMemory() )) log.debug('test memory: ', ('%.3f'):format(os.clock() - clock)) - if deadValue / totalValue >= 0.5 then + if deadValue / totalValue >= 0.5 and not skipDead then self:_testFindDeadValues() end end diff --git a/server/src/task.lua b/server/src/task.lua index 88db7a28..bb1a7922 100644 --- a/server/src/task.lua +++ b/server/src/task.lua @@ -7,6 +7,7 @@ function mt:remove() return end self._removed = true + coroutine.close(self.task) end function mt:isRemoved() -- cgit v1.2.3