mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-28 16:01:30 +00:00
Fix #3907
This commit is contained in:
parent
08b9908f6e
commit
e3a082d58d
1 changed files with 2 additions and 1 deletions
|
@ -79,7 +79,7 @@ class ExchangeBase(PrintError):
|
||||||
return h, timestamp
|
return h, timestamp
|
||||||
|
|
||||||
def get_historical_rates_safe(self, ccy, cache_dir):
|
def get_historical_rates_safe(self, ccy, cache_dir):
|
||||||
h, timestamp = self.read_historical_rates()
|
h, timestamp = self.read_historical_rates(ccy, cache_dir)
|
||||||
if h is None or time.time() - timestamp < 24*3600:
|
if h is None or time.time() - timestamp < 24*3600:
|
||||||
try:
|
try:
|
||||||
self.print_error("requesting fx history for", ccy)
|
self.print_error("requesting fx history for", ccy)
|
||||||
|
@ -89,6 +89,7 @@ class ExchangeBase(PrintError):
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
self.print_error("failed fx history:", e)
|
self.print_error("failed fx history:", e)
|
||||||
return
|
return
|
||||||
|
filename = os.path.join(cache_dir, self.name() + '_' + ccy)
|
||||||
with open(filename, 'w') as f:
|
with open(filename, 'w') as f:
|
||||||
f.write(json.dumps(h))
|
f.write(json.dumps(h))
|
||||||
self.history[ccy] = h
|
self.history[ccy] = h
|
||||||
|
|
Loading…
Add table
Reference in a new issue