From 3566271601c461652ad7eeccea6b49a6791a38ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0abata?= Date: Sat, 9 Jul 2016 18:18:10 +0200 Subject: [PATCH] Add polling_interval to config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will be used by ridad. Signed-off-by: Petr Ĺ abata --- rida.conf | 4 ++++ rida/config.py | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/rida.conf b/rida.conf index 04d896d6..93f6003d 100644 --- a/rida.conf +++ b/rida.conf @@ -7,6 +7,10 @@ db = sqlite:///rida.db pdc = http://pdc.stg.fedoraproject.org/ scmurls = ["git://pkgs.stg.fedoraproject.org/modules/"] +# How often should we resort to polling, in seconds +# Set to zero to disable polling +polling_interval = 60 + rpms_default_repository = git://pkgs.fedoraproject.org/rpms/ rpms_allow_repository = False rpms_default_cache = http://pkgs.fedoraproject.org/repo/pkgs/ diff --git a/rida/config.py b/rida/config.py index 18fa6724..51f861ce 100644 --- a/rida/config.py +++ b/rida/config.py @@ -79,8 +79,9 @@ class Config(object): self._messaging = "" self._db = "" self._pdc = "" + self._polling_interval = 0 self._koji_config = None - self._koji_profile = None + self._koji_profile = None self._koji_arches = None self._rpms_default_repository = "" self._rpms_allow_repository = False @@ -136,6 +137,19 @@ class Config(object): def pdc(self, s): self._pdc = str(s) + @property + def polling_interval(self): + """Polling interval, in seconds.""" + return self._polling_interval + + @polling_interval.setter + def polling_interval(self, i): + if not isinstance(i, int): + raise TypeError("polling_interval needs to be an int") + if i < 0: + raise ValueError("polling_interval must be >= 0") + self._polling_interval = i + @property def koji_config(self): """Koji URL.""" @@ -154,7 +168,7 @@ class Config(object): @koji_profile.setter def koji_profile(self, s): self._koji_profile = str(s) - + @property def koji_arches(self): """Koji architectures."""