Revert "fix(#1961): cycle detection on refresh, preventing infinite loop (#1996)"

This reverts commit 4222bb875d.
This commit is contained in:
Alexander Courtis
2023-02-15 09:24:12 +11:00
parent 4222bb875d
commit 08a0aa1a3b

View File

@@ -166,9 +166,6 @@ function M.refresh_nodes_for_path(path)
local profile = log.profile_start("refresh_nodes_for_path %s", path)
-- avoids cycles
local paths_refreshed = {}
NodeIterator.builder({ explorer })
:hidden()
:recursor(function(node)
@@ -180,13 +177,10 @@ function M.refresh_nodes_for_path(path)
end
end)
:applier(function(node)
local abs_contains = node.absolute_path and path:find(node.absolute_path, 1, true) ~= 1
local link_contains = node.link_to and path:find(node.link_to, 1, true) ~= 1
local abs_contains = node.absolute_path and path:match("^" .. node.absolute_path)
local link_contains = node.link_to and path:match("^" .. node.link_to)
if abs_contains or link_contains then
if not paths_refreshed[node.absolute_path] then
paths_refreshed[node.absolute_path] = true
M.refresh_node(node)
end
M.refresh_node(node)
end
end)
:iterate()