fix: issue with cache.setex

This commit is contained in:
Dany Robert 2021-07-29 15:58:27 +05:30 committed by GitHub
parent 4e96563c92
commit 909995a441
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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")