diff options
| author | ruki <[email protected]> | 2022-05-14 20:19:03 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-05-14 20:19:03 +0800 |
| commit | 6fd5bf28ad8fb2025f1930bb580be7448d4101c9 (patch) | |
| tree | d3cc70f068f942042b20a7cbb9b2a0bf5d02035e /xmake/modules | |
| parent | 4222691b52b1c621312b18eccb4d60146078adb7 (diff) | |
improve distcc
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/private/service/distcc_build/client.lua | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/xmake/modules/private/service/distcc_build/client.lua b/xmake/modules/private/service/distcc_build/client.lua index 633e3b89b..599e123b1 100644 --- a/xmake/modules/private/service/distcc_build/client.lua +++ b/xmake/modules/private/service/distcc_build/client.lua @@ -192,6 +192,11 @@ function distcc_build_client:freejobs() return 0 end +-- has free jobs? +function distcc_build_client:has_freejobs() + return self:freejobs() > 0 +end + -- run compilation job function distcc_build_client:iorunv(program, argv, opt) @@ -250,7 +255,7 @@ end function distcc_build_client:_get_freehost() local max_weight = -1 local host - if self:_has_freejobs() then + if self:has_freejobs() then for _, host_status in pairs(self:hosts_status()) do if host_status.freejobs > 0 and host_status.weight > max_weight then max_weight = host_status.weight @@ -305,12 +310,6 @@ function distcc_build_client:_host_status_unlock(host_status) self._RUNNING = running end - --- has free jobs? -function distcc_build_client:_has_freejobs() - return self:freejobs() > 0 -end - -- get the session id, only for unique project function distcc_build_client:_session_id(addr, port) local hosts = self:status().hosts |
