From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/_async/, pym/_emerge/
Date: Mon, 8 Oct 2012 20:44:46 +0000 (UTC) [thread overview]
Message-ID: <1349729062.91b253ba2f249b19d6cc68f51cd6b909a765a715.zmedico@gentoo> (raw)
commit: 91b253ba2f249b19d6cc68f51cd6b909a765a715
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 8 20:44:22 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 8 20:44:22 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=91b253ba
PollScheduler: disable default _loadavg_latency
Move the 30 second default to the Scheduler class, since that's the
only place that it's currently needed (all other schedulers have
relatively short-running jobs).
---
pym/_emerge/PollScheduler.py | 2 +-
pym/_emerge/Scheduler.py | 7 ++++++-
pym/portage/util/_async/AsyncScheduler.py | 4 +++-
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/pym/_emerge/PollScheduler.py b/pym/_emerge/PollScheduler.py
index 1a81e2d..d02b0da 100644
--- a/pym/_emerge/PollScheduler.py
+++ b/pym/_emerge/PollScheduler.py
@@ -15,7 +15,7 @@ from _emerge.getloadavg import getloadavg
class PollScheduler(object):
# max time between loadavg checks (milliseconds)
- _loadavg_latency = 30000
+ _loadavg_latency = None
def __init__(self, main=False, event_loop=None):
"""
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index 40033c2..3b55b2b 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -66,6 +66,9 @@ if sys.hexversion >= 0x3000000:
class Scheduler(PollScheduler):
+ # max time between loadavg checks (milliseconds)
+ _loadavg_latency = 30000
+
# max time between display status updates (milliseconds)
_max_display_latency = 3000
@@ -1339,7 +1342,9 @@ class Scheduler(PollScheduler):
def _main_loop(self):
term_check_id = self._event_loop.idle_add(self._termination_check)
loadavg_check_id = None
- if self._max_load is not None:
+ if self._max_load is not None and \
+ self._loadavg_latency is not None and \
+ (self._max_jobs is True or self._max_jobs > 1):
# We have to schedule periodically, in case the load
# average has changed since the last call.
loadavg_check_id = self._event_loop.timeout_add(
diff --git a/pym/portage/util/_async/AsyncScheduler.py b/pym/portage/util/_async/AsyncScheduler.py
index c6a37f5..182e19e 100644
--- a/pym/portage/util/_async/AsyncScheduler.py
+++ b/pym/portage/util/_async/AsyncScheduler.py
@@ -66,7 +66,9 @@ class AsyncScheduler(AsynchronousTask, PollScheduler):
def _start(self):
self._term_check_id = self._event_loop.idle_add(self._termination_check)
- if self._max_load is not None:
+ if self._max_load is not None and \
+ self._loadavg_latency is not None and \
+ (self._max_jobs is True or self._max_jobs > 1):
# We have to schedule periodically, in case the load
# average has changed since the last call.
self._loadavg_check_id = self._event_loop.timeout_add(
next reply other threads:[~2012-10-08 20:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-08 20:44 Zac Medico [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-03-24 20:33 [gentoo-commits] proj/portage:master commit in: pym/portage/util/_async/, pym/_emerge/ Zac Medico
2013-01-06 11:16 Zac Medico
2012-10-19 1:23 Zac Medico
2012-10-19 1:15 Zac Medico
2012-10-16 19:28 Zac Medico
2012-10-07 18:51 Zac Medico
2012-10-07 18:22 Zac Medico
2012-10-07 18:17 Zac Medico
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1349729062.91b253ba2f249b19d6cc68f51cd6b909a765a715.zmedico@gentoo \
--to=zmedico@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox