From 668c6b62a8e7f2e820be4e6143119fdff2a5bc2f Mon Sep 17 00:00:00 2001 From: Vivek Teega Date: Sat, 21 Mar 2020 18:36:20 +0000 Subject: [PATCH] Minor fix --- ranchimallflo_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ranchimallflo_api.py b/ranchimallflo_api.py index 61ede37..99f34f3 100644 --- a/ranchimallflo_api.py +++ b/ranchimallflo_api.py @@ -1110,7 +1110,7 @@ def updatePrices(): f"https://api.exchangeratesapi.io/latest?base=USD&symbols=INR") try: price = response.json() - prices['USDINR'] = price['quotes']['USDINR'] + prices['USDINR'] = price['rates']['INR'] except ValueError: response = requests.get( f"https://api.exchangerate-api.com/v4/latest/usd") @@ -1198,7 +1198,7 @@ if not os.path.isfile(f"system.db"): # assign a scheduler for updating prices in the background scheduler = BackgroundScheduler() -scheduler.add_job(func=updatePrices, trigger="interval", seconds=30) +scheduler.add_job(func=updatePrices, trigger="interval", seconds=600) scheduler.start() # Shut down the scheduler when exiting the app atexit.register(lambda: scheduler.shutdown())