From 7beb65e991bc6d1913c3b5bb2ef69e659d5b8342 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 10 Mar 2015 01:55:52 +0100 Subject: Spare code cosmetics --- module/plugins/hooks/RestartFailed.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks/RestartFailed.py') diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 07fb80967..7752b6a61 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -17,13 +17,13 @@ class RestartFailed(Hook): # event_list = ["pluginConfigChanged"] - MIN_INTERVAL = 15 * 60 #: 15m minimum check interval (value is in seconds) + MIN_CHECK_INTERVAL = 15 * 60 #: 15 minutes def pluginConfigChanged(self, plugin, name, value): if name == "interval": interval = value * 60 - if self.MIN_INTERVAL <= interval != self.interval: + if self.MIN_CHECK_INTERVAL <= interval != self.interval: self.core.scheduler.removeJob(self.cb) self.interval = interval self.initPeriodical() @@ -37,8 +37,8 @@ class RestartFailed(Hook): def setup(self): - self.interval = self.MIN_INTERVAL + 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')) -- cgit v1.2.3 From 331045a39c1d52aef16d51fa4ae1f52ed4f8dc36 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 10 Mar 2015 22:45:26 +0100 Subject: Tiny code cosmetics --- module/plugins/hooks/RestartFailed.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hooks/RestartFailed.py') diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 7752b6a61..d0424bd1f 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -10,7 +10,7 @@ class RestartFailed(Hook): __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")] -- cgit v1.2.3 From 2bc144adb6bc2759b635e09687b27bf96074827f Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 18 Mar 2015 13:39:07 +0100 Subject: Spare code cosmetics --- module/plugins/hooks/RestartFailed.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hooks/RestartFailed.py') diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index d0424bd1f..6eef90ffe 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -37,6 +37,7 @@ class RestartFailed(Hook): def setup(self): + self.info = {} #@TODO: Remove in 0.4.10 self.interval = self.MIN_CHECK_INTERVAL -- cgit v1.2.3 From 753b3c9daee9926c84d4053864af2079fcfc8557 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 18 Mar 2015 16:01:23 +0100 Subject: Spare code cosmetics (2) --- module/plugins/hooks/RestartFailed.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'module/plugins/hooks/RestartFailed.py') diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index 6eef90ffe..c861e9c41 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -20,15 +20,15 @@ class RestartFailed(Hook): MIN_CHECK_INTERVAL = 15 * 60 #: 15 minutes - 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 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): -- cgit v1.2.3 From b9219fa1859de12de010a07c4c92a9f0270042ac Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 21 Mar 2015 17:17:03 +0100 Subject: [DeleteFinished] Define MIN_CHECK_INTERVAL --- module/plugins/hooks/RestartFailed.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module/plugins/hooks/RestartFailed.py') diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index c861e9c41..cab986d9e 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -6,7 +6,7 @@ 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)] @@ -42,4 +42,5 @@ class RestartFailed(Hook): 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) -- cgit v1.2.3 From 9f3ab57ec994deb24cd31a1dfbd338eb71bffc8c Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 27 May 2015 23:46:29 +0200 Subject: Spare code cosmetics --- module/plugins/hooks/RestartFailed.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/hooks/RestartFailed.py') diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py index cab986d9e..865af2a6b 100644 --- a/module/plugins/hooks/RestartFailed.py +++ b/module/plugins/hooks/RestartFailed.py @@ -15,8 +15,6 @@ class RestartFailed(Hook): __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] - # event_list = ["pluginConfigChanged"] - MIN_CHECK_INTERVAL = 15 * 60 #: 15 minutes @@ -37,7 +35,8 @@ class RestartFailed(Hook): def setup(self): - self.info = {} #@TODO: Remove in 0.4.10 + self.info = {} #@TODO: Remove in 0.4.10 + # self.event_list = ["pluginConfigChanged"] self.interval = self.MIN_CHECK_INTERVAL -- cgit v1.2.3