fix issue with cache.setex

This commit is contained in:
Dany Robert
2021-07-29 16:00:35 +05:30
committed by GitHub
parent 3302ed4658
commit 239974c73e

View File

@@ -107,7 +107,7 @@ def get_exchange_rate(from_currency, to_currency, transaction_date=None, args=No
# expire in 6 hours
response.raise_for_status()
value = response.json()["result"]
cache.setex(key, value, 6 * 60 * 60)
cache.setex(name=key, time=21600, value=flt(value))
return flt(value)
except:
frappe.log_error(title="Get Exchange Rate")