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