Remove priority run mechanism
This commit is contained in:
parent
9a12d47afd
commit
9e8e8f7543
|
@ -56,8 +56,6 @@ function core.open_folder_project(dirname)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function project_scan_thread()
|
local function project_scan_thread()
|
||||||
local priority_run = true
|
|
||||||
|
|
||||||
local function diff_files(a, b)
|
local function diff_files(a, b)
|
||||||
if #a ~= #b then return true end
|
if #a ~= #b then return true end
|
||||||
for i, v in ipairs(a) do
|
for i, v in ipairs(a) do
|
||||||
|
@ -73,7 +71,7 @@ local function project_scan_thread()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_files(path, t)
|
local function get_files(path, t)
|
||||||
if not priority_run then coroutine.yield() end
|
coroutine.yield()
|
||||||
t = t or {}
|
t = t or {}
|
||||||
local size_limit = config.file_size_limit * 10e5
|
local size_limit = config.file_size_limit * 10e5
|
||||||
local all = system.list_dir(path) or {}
|
local all = system.list_dir(path) or {}
|
||||||
|
@ -123,13 +121,11 @@ local function project_scan_thread()
|
||||||
end
|
end
|
||||||
core.project_files = t
|
core.project_files = t
|
||||||
core.redraw = true
|
core.redraw = true
|
||||||
priority_run = false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- wait for next scan
|
-- wait for next scan
|
||||||
if core.switch_project then
|
if core.switch_project then
|
||||||
system.chdir(core.switch_project)
|
system.chdir(core.switch_project)
|
||||||
priority_run = true
|
|
||||||
core.switch_project = nil
|
core.switch_project = nil
|
||||||
else
|
else
|
||||||
coroutine.yield(config.project_scan_rate)
|
coroutine.yield(config.project_scan_rate)
|
||||||
|
|
Loading…
Reference in New Issue