From 1041fc44ec3de9daf5ba7f4306b1cdbf39313e69 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Thu, 21 Jan 2021 17:48:19 -0600 Subject: [PATCH] Not caching all in memory now. --- fanficfare/chromagnon/cacheEntry.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/fanficfare/chromagnon/cacheEntry.py b/fanficfare/chromagnon/cacheEntry.py index 01eda589..7419c2e1 100644 --- a/fanficfare/chromagnon/cacheEntry.py +++ b/fanficfare/chromagnon/cacheEntry.py @@ -108,18 +108,19 @@ class CacheEntry(): # It is probably an HTTP header self.key = cacheData.CacheData(addr, self.keyLength, True) - try: - # Some keys seem to be '_dk_http://example.com https://example.com https://www.example.com/full/url/path' - # fix those up so the actual URL will work as a hash key - # in our table if key has whitespace followed by final - # http[s]://something, substitute, otherwise this leaves - # it unchanged - self.key = re.sub(r'^.*\s(https?://\S+)$', r'\1', self.key) - except TypeError: - ## Some 'keys' are not bytes or text types. No idea why - ## not. - # print(self.key) - pass + # print("cacheEntry key:%s"%self.key) + # try: + # # Some keys seem to be '_dk_http://example.com https://example.com https://www.example.com/full/url/path' + # # fix those up so the actual URL will work as a hash key + # # in our table if key has whitespace followed by final + # # http[s]://something, substitute, otherwise this leaves + # # it unchanged + # self.key = re.sub(r'^.*\s(https?://\S+)$', r'\1', self.key) + # except TypeError: + # ## Some 'keys' are not bytes or text types. No idea why + # ## not. + # # print(self.key) + # pass block.close() def keyToStr(self):