mirror of
https://github.com/lalanza808/monero.fail.git
synced 2025-08-20 10:58:11 -04:00
remove unused rw_cache
This commit is contained in:
parent
a44da731e9
commit
269a9c31a2
3 changed files with 2 additions and 21 deletions
|
@ -83,23 +83,6 @@ def is_onion(url: str):
|
|||
else:
|
||||
return False
|
||||
|
||||
|
||||
# Use hacky filesystem cache since i dont feel like shipping redis
|
||||
def rw_cache(key_name, data=None):
|
||||
pickle_file = path.join(config.DATA_DIR, f"{key_name}.pkl")
|
||||
if data:
|
||||
with open(pickle_file, "wb") as f:
|
||||
f.write(pickle.dumps(data))
|
||||
return data
|
||||
else:
|
||||
try:
|
||||
with open(pickle_file, "rb") as f:
|
||||
pickled_data = pickle.load(f)
|
||||
return pickled_data
|
||||
except:
|
||||
return {}
|
||||
|
||||
|
||||
def retrieve_peers(host, port):
|
||||
try:
|
||||
sock = socket.socket()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue