This commit is contained in:
Ruud
2012-02-03 17:25:56 +01:00
parent 9cc1679fb5
commit 8ac8a1a49c
4 changed files with 31 additions and 21 deletions
+2 -2
View File
@@ -173,7 +173,7 @@ class Plugin(object):
log.error("Something went wrong when finishing the plugin function. Could not find the 'is_running' key")
def getCache(self, cache_key, url = None):
def getCache(self, cache_key, url = None, timeout = 300):
cache = Env.get('cache').get(cache_key)
if cache:
if not Env.setting('development'): log.debug('Getting cache %s' % cache_key)
@@ -182,7 +182,7 @@ class Plugin(object):
if url:
try:
data = self.urlopen(url)
self.setCache(cache_key, data)
self.setCache(cache_key, data, timeout = timeout)
return data
except:
pass