mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
sync: use integer division with job counts
Neither of the fields here expect floats so make sure we use integer division when calculating things. Bug: https://crbug.com/gerrit/10418 Change-Id: Ibda068b16a7bba7ff3efba442c4bbff4415caa6e
This commit is contained in:
parent
9e71842fbf
commit
0c0e934b69
@ -436,7 +436,7 @@ later is required to fix a server side protocol bug.
|
||||
bare_git.gc('--auto')
|
||||
return
|
||||
|
||||
config = {'pack.threads': cpu_count / jobs if cpu_count > jobs else 1}
|
||||
config = {'pack.threads': cpu_count // jobs if cpu_count > jobs else 1}
|
||||
|
||||
threads = set()
|
||||
sem = _threading.Semaphore(jobs)
|
||||
@ -598,7 +598,7 @@ later is required to fix a server side protocol bug.
|
||||
self.jobs = opt.jobs
|
||||
if self.jobs > 1:
|
||||
soft_limit, _ = _rlimit_nofile()
|
||||
self.jobs = min(self.jobs, (soft_limit - 5) / 3)
|
||||
self.jobs = min(self.jobs, (soft_limit - 5) // 3)
|
||||
|
||||
if opt.network_only and opt.detach_head:
|
||||
print('error: cannot combine -n and -d', file=sys.stderr)
|
||||
|
Loading…
Reference in New Issue
Block a user