summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-05-18 23:49:05 +0800
committerruki <[email protected]>2021-05-18 23:49:05 +0800
commitf835bf4a93025bd4e8877cc16a5f287333d0f9cb (patch)
tree2f73932ac39011d90309fecc42391cd601cd9b57
parent9182c06e0aa51f7bcbdff3ec9477fb0ffe53c940 (diff)
improve runjobs
-rw-r--r--xmake/modules/private/action/require/impl/install_packages.lua4
-rw-r--r--xmake/modules/private/async/runjobs.lua2
2 files changed, 4 insertions, 2 deletions
diff --git a/xmake/modules/private/action/require/impl/install_packages.lua b/xmake/modules/private/action/require/impl/install_packages.lua
index 0adea1fc9..e2d97e2f3 100644
--- a/xmake/modules/private/action/require/impl/install_packages.lua
+++ b/xmake/modules/private/action/require/impl/install_packages.lua
@@ -388,7 +388,9 @@ function main(requires, opt)
instance:fetch()
os.setenvs(oldenvs)
end
- end, {total = #packages, isolate = true})
+ end, {total = #packages,
+ comax = (option.get("verbose") or option.get("diagnosis")) and 1 or 4,
+ isolate = true})
-- register all required root packages to local cache
register_packages(packages)
diff --git a/xmake/modules/private/async/runjobs.lua b/xmake/modules/private/async/runjobs.lua
index 6a2964a90..487d11798 100644
--- a/xmake/modules/private/async/runjobs.lua
+++ b/xmake/modules/private/async/runjobs.lua
@@ -56,7 +56,7 @@ function main(name, jobs, opt)
-- init options
op = opt or {}
local total = opt.total or (type(jobs) == "table" and jobs:size()) or 1
- local comax = opt.comax or total
+ local comax = opt.comax or math.min(total, 4)
local timeout = opt.timeout or 500
local group_name = name
local jobs_cb = type(jobs) == "function" and jobs or nil