increased data expiration time: +10 minutes

This commit is contained in:
Igor Chubin 2020-05-21 13:22:07 +02:00
parent 8346bef3ac
commit 6e02c0a147

View file

@ -84,7 +84,7 @@ def _cache_file(path, query):
digest = hashlib.sha1(("%s %s" % (path, query)).encode("utf-8")).hexdigest() digest = hashlib.sha1(("%s %s" % (path, query)).encode("utf-8")).hexdigest()
digest_number = ord(digest[0].upper()) digest_number = ord(digest[0].upper())
expiry_interval = 60*(digest_number+10) expiry_interval = 60*(digest_number+20)
timestamp = "%010d" % (int(time.time())//expiry_interval*expiry_interval) timestamp = "%010d" % (int(time.time())//expiry_interval*expiry_interval)
filename = os.path.join(PROXY_CACHEDIR, timestamp, path, query) filename = os.path.join(PROXY_CACHEDIR, timestamp, path, query)