diff --git a/service/sharedatad.lua b/service/sharedatad.lua index 3877ec39..d7439493 100644 --- a/service/sharedatad.lua +++ b/service/sharedatad.lua @@ -8,7 +8,7 @@ local NORET = {} local pool = {} local pool_count = {} local objmap = {} -local collect_tick = 600 +local collect_tick = 10 local function newobj(name, tbl) assert(pool[name] == nil) @@ -20,17 +20,17 @@ local function newobj(name, tbl) pool_count[name] = { n = 0, threshold = 16 } end -local function collect10sec() - if collect_tick > 10 then - collect_tick = 10 +local function collect1min() + if collect_tick > 1 then + collect_tick = 1 end end local function collectobj() while true do - skynet.sleep(100) -- sleep 1s + skynet.sleep(60*100) -- sleep 1min if collect_tick <= 0 then - collect_tick = 600 -- reset tick count to 600 sec + collect_tick = 10 -- reset tick count to 10 min collectgarbage() for obj, v in pairs(objmap) do if v == true then @@ -121,7 +121,7 @@ function CMD.update(name, t, ...) response(true, newobj) end end - collect10sec() -- collect in 10 sec + collect1min() -- collect in 1 min end local function check_watch(queue)