summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
authorGravatar Vuolter <vuolter@gmail.com> 2013-05-11 19:28:38 +0200
committerGravatar Vuolter <vuolter@gmail.com> 2013-05-11 19:28:38 +0200
commita133bdfe5e673479f3441afa7ae2f7c337753852 (patch)
tree0de49ee5221520c9f83bd763ff990e574a27a5a2 /module/plugins
parentAdded plugin DeleteFinished, version 0.1 (diff)
downloadpyload-a133bdfe5e673479f3441afa7ae2f7c337753852.tar.xz
Version 0.2: fixes
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/hooks/DeleteFinished.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py
index 6098db9a5..be83d6ced 100644
--- a/module/plugins/hooks/DeleteFinished.py
+++ b/module/plugins/hooks/DeleteFinished.py
@@ -23,19 +23,18 @@ from time import time
class DeleteFinished(Hook):
__name__ = "DeleteFinished"
- __version__ = "0.1"
+ __version__ = "0.2"
__description__ = "Automatically delete finished packages from queue"
__config__ = [
("activated", "bool", "Activated", "False"),
- ("interval", "int", "Delete every (hours)", "48")
+ ("interval", "int", "Delete every (hours)", "72")
]
__author_name__ = ("Walter Purcaro")
__author_mail__ = ("vuolter@gmail.com")
- event_map = {"periodical": "check"}
-
- def check(self):
- now = time.time()
+ #: event_map don't load periodical anyway
+ def periodical(self):
+ now = time()
deletetime = self.getConfig("interval") * 3600 + self.info["lastdelete"]
if now >= deletetime:
self.core.api.deleteFinished()
@@ -43,6 +42,6 @@ class DeleteFinished(Hook):
self.info["lastdelete"] = now
def setup(self):
- now = time.time()
+ now = time()
self.info = {"lastdelete": now}
self.interval = 3600