From 881fab2e2bb5b935da5354d501972881a7777605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 18 Jun 2021 18:01:00 +0800 Subject: allow more steps --- script/core/searcher.lua | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'script') diff --git a/script/core/searcher.lua b/script/core/searcher.lua index 05733af4..79e80577 100644 --- a/script/core/searcher.lua +++ b/script/core/searcher.lua @@ -373,7 +373,7 @@ function m.searchRefsByID(status, uri, expect, mode) local btag = {} local function checkThenPushTag(ward, tag) - if not tag then + if not tag or tag == 'deep' then return true end local checkTags @@ -393,7 +393,7 @@ function m.searchRefsByID(status, uri, expect, mode) end local function popTag(ward, tag) - if not tag then + if not tag or tag == 'deep' then return end local popTags @@ -602,11 +602,22 @@ function m.searchRefsByID(status, uri, expect, mode) end local stepCount = 0 + local stepMaxCount = 1e3 + local statusMaxCount = 1e4 + if mode == 'allref' then + stepMaxCount = 1e4 + statusMaxCount = 1e5 + end function searchStep(id, field) stepCount = stepCount + 1 status.count = status.count + 1 - if stepCount > 1000 - or status.count > 10000 then + if mode == 'allref' then + if status.count % 1e4 == 0 then + await.delay() + end + end + if stepCount > stepMaxCount + or status.count > statusMaxCount then if TEST then if FOOTPRINT then log.debug(table.concat(status.footprint, '\n')) -- cgit v1.2.3