summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Vuolter <vuolter@gmail.com> 2013-05-07 08:17:31 +0200
committerGravatar Vuolter <vuolter@gmail.com> 2013-05-12 14:54:32 +0200
commitbe8e019964119e4a074ecef417f0cd38292d0eee (patch)
tree75d4ad7fd00405d6bec47217d6ea79363efa185f /module/plugins
parentVersion 0.4: fixes (diff)
downloadpyload-be8e019964119e4a074ecef417f0cd38292d0eee.tar.xz
Version 0.5: fixes again
Diffstat (limited to 'module/plugins')
-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"):