summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks/RestartFailed.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks/RestartFailed.py')
-rw-r--r--module/plugins/hooks/RestartFailed.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/module/plugins/hooks/RestartFailed.py b/module/plugins/hooks/RestartFailed.py
index 24bbe85c4..11308c963 100644
--- a/module/plugins/hooks/RestartFailed.py
+++ b/module/plugins/hooks/RestartFailed.py
@@ -23,7 +23,7 @@ import time
class RestartFailed(Hook):
__name__ = "RestartFailed"
- __version__ = "0.4"
+ __version__ = "0.5"
__description__ = "Restart failed packages according to defined rules"
__config__ = [
("activated", "bool", "Activated", "True"),
@@ -42,24 +42,24 @@ class RestartFailed(Hook):
def checkInterval(self, interval):
now = time()
interval *= 60
- if now >= lastime + interval:
- lastime = now
+ if now >= self.lastime + interval:
+ self.lastime = now
return True
else:
return False
def downloadFailed(self, pyfile):
if not self.getConfig("dlFailed"):
- failed = 0
+ self.failed = 0
return
number = self.getConfig("dlFailed_n")
interval = self.getConfig("dlFailed_i")
- if failed > number and checkInterval(interval):
+ if self.failed > number and checkInterval(interval):
self.core.api.restartFailed()
- self.logDebug("executed after " + failed + " downloads failed")
- failed = 0
+ self.logDebug("executed after " + self.failed + " failed downloads")
+ self.failed = 0
else:
- failed + 1
+ self.failed += 1
def packageFinished(self, pypack):
if not self.getConfig("packFinished"):