summaryrefslogtreecommitdiffstats
path: root/subcmds/sync.py
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r--subcmds/sync.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 49874c44..3dc74f1f 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -350,6 +350,8 @@ later is required to fix a server side protocol bug.
350 # value later on. 350 # value later on.
351 PARALLEL_JOBS = 0 351 PARALLEL_JOBS = 0
352 352
353 _JOBS_WARN_THRESHOLD = 100
354
353 def _Options(self, p, show_smart=True): 355 def _Options(self, p, show_smart=True):
354 p.add_option( 356 p.add_option(
355 "--jobs-network", 357 "--jobs-network",
@@ -1728,6 +1730,24 @@ later is required to fix a server side protocol bug.
1728 opt.jobs_network = min(opt.jobs_network, jobs_soft_limit) 1730 opt.jobs_network = min(opt.jobs_network, jobs_soft_limit)
1729 opt.jobs_checkout = min(opt.jobs_checkout, jobs_soft_limit) 1731 opt.jobs_checkout = min(opt.jobs_checkout, jobs_soft_limit)
1730 1732
1733 # Warn once if effective job counts seem excessively high.
1734 # Prioritize --jobs, then --jobs-network, then --jobs-checkout.
1735 job_options_to_check = (
1736 ("--jobs", opt.jobs),
1737 ("--jobs-network", opt.jobs_network),
1738 ("--jobs-checkout", opt.jobs_checkout),
1739 )
1740 for name, value in job_options_to_check:
1741 if value > self._JOBS_WARN_THRESHOLD:
1742 logger.warning(
1743 "High job count (%d > %d) specified for %s; this may "
1744 "lead to excessive resource usage or diminishing returns.",
1745 value,
1746 self._JOBS_WARN_THRESHOLD,
1747 name,
1748 )
1749 break
1750
1731 def Execute(self, opt, args): 1751 def Execute(self, opt, args):
1732 errors = [] 1752 errors = []
1733 try: 1753 try: