diff options
author | GammaC0de <GammaC0de@users.noreply.github.com> | 2015-05-29 23:33:10 +0200 |
---|---|---|
committer | GammaC0de <GammaC0de@users.noreply.github.com> | 2015-05-29 23:33:10 +0200 |
commit | 844dfd92f590e531ca2f7fd86305fcbc13a03721 (patch) | |
tree | 5303bd07749b362dab071ada6197fe37dda85b27 /module/plugins/hooks/RestartFailed.py | |
parent | [BitshareCom] Code cosmetics (diff) | |
parent | [SimpleHoster] Fix DB error (diff) | |
download | pyload-844dfd92f590e531ca2f7fd86305fcbc13a03721.tar.xz |
Merge pull request #1 from pyload/stable
sync stable
Diffstat (limited to 'module/plugins/hooks/RestartFailed.py')
-rw-r--r-- | module/plugins/hooks/RestartFailed.py | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 07fb80967..865af2a6b 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -6,29 +6,27 @@ from module.plugins.Hook import Hook class RestartFailed(Hook): __name__ = "RestartFailed" __type__ = "hook" - __version__ = "1.57" + __version__ = "1.58" __config__ = [("interval", "int", "Check interval in minutes", 90)] - __description__ = """Periodically restart all failed downloads in queue""" + __description__ = """Restart all the failed downloads in queue""" __license__ = "GPLv3" __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - # event_list = ["pluginConfigChanged"] + MIN_CHECK_INTERVAL = 15 * 60 #: 15 minutes - MIN_INTERVAL = 15 * 60 #: 15m minimum check interval (value is in seconds) - - def pluginConfigChanged(self, plugin, name, value): - if name == "interval": - interval = value * 60 - if self.MIN_INTERVAL <= interval != self.interval: - self.core.scheduler.removeJob(self.cb) - self.interval = interval - self.initPeriodical() - else: - self.logDebug("Invalid interval value, kept current") + # def pluginConfigChanged(self, plugin, name, value): + # if name == "interval": + # interval = value * 60 + # if self.MIN_CHECK_INTERVAL <= interval != self.interval: + # self.core.scheduler.removeJob(self.cb) + # self.interval = interval + # self.initPeriodical() + # else: + # self.logDebug("Invalid interval value, kept current") def periodical(self): @@ -37,8 +35,11 @@ class RestartFailed(Hook): def setup(self): - self.interval = self.MIN_INTERVAL + self.info = {} #@TODO: Remove in 0.4.10 + # self.event_list = ["pluginConfigChanged"] + self.interval = self.MIN_CHECK_INTERVAL def coreReady(self): - self.pluginConfigChanged(self.__name__, "interval", self.getConfig("interval")) + # self.pluginConfigChanged(self.__name__, "interval", self.getConfig('interval')) + self.interval = max(self.MIN_CHECK_INTERVAL, self.getConfig('interval') * 60) |