summaryrefslogtreecommitdiffstats
path: root/pyload/datatypes
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-09-29 13:03:17 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-09-29 13:03:17 +0200
commit6a997661dc5c259f844531382a90a4ca120f1233 (patch)
tree085a76d4bac208963649a62f9393e0c0b049e869 /pyload/datatypes
parentrewritten decrypter and info fetching thread (diff)
downloadpyload-6a997661dc5c259f844531382a90a4ca120f1233.tar.xz
basics for web setup
Diffstat (limited to 'pyload/datatypes')
-rw-r--r--pyload/datatypes/OnlineCheck.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pyload/datatypes/OnlineCheck.py b/pyload/datatypes/OnlineCheck.py
index 2797828bf..b0b19cf76 100644
--- a/pyload/datatypes/OnlineCheck.py
+++ b/pyload/datatypes/OnlineCheck.py
@@ -5,6 +5,7 @@ from time import time
from pyload.Api import OnlineCheck as OC
+
class OnlineCheck:
""" Helper class that holds result of an initiated online check """
@@ -16,6 +17,10 @@ class OnlineCheck:
self.timestamp = time()
+ def isStale(self, timeout=5):
+ """ checks if the data was updated or accessed recently """
+ return self.timestamp + timeout * 60 < time()
+
def update(self, result):
self.timestamp = time()
self.result.update(result)