database caller crash fix
This commit is contained in:
@@ -552,10 +552,15 @@ def checkStocks(last_update, update_frequency):
|
|||||||
|
|
||||||
def updateAll(api_key, weather_key):
|
def updateAll(api_key, weather_key):
|
||||||
updateStocks(api_key)
|
updateStocks(api_key)
|
||||||
|
|
||||||
updateCrypto(api_key)
|
updateCrypto(api_key)
|
||||||
|
|
||||||
updateForex(api_key)
|
updateForex(api_key)
|
||||||
|
|
||||||
updateNews(api_key)
|
updateNews(api_key)
|
||||||
|
|
||||||
updateSports(api_key)
|
updateSports(api_key)
|
||||||
|
|
||||||
if weather_key:
|
if weather_key:
|
||||||
updateWeather(weather_key)
|
updateWeather(weather_key)
|
||||||
|
|
||||||
@@ -626,8 +631,20 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
msg = getInput()
|
msg = getInput()
|
||||||
if msg == 'A':
|
if msg == 'A':
|
||||||
updateAll(api_key, weather_key)
|
update_process = Process(target = updateAll, args = (api_key,weather_key))
|
||||||
|
update_process.start()
|
||||||
|
update_processes.append(update_process)
|
||||||
|
stock_time = NY_time.strftime("%d/%m/%Y %H:%M:%S")
|
||||||
|
last_updates['stocks'] = stock_time
|
||||||
|
last_updates['crypto'] = stock_time
|
||||||
|
last_updates['weather'] = stock_time
|
||||||
|
last_updates['news'] = stock_time
|
||||||
|
last_updates['sports'] = stock_time
|
||||||
|
CET_time = datetime.now(CET_zone)
|
||||||
|
forex_time = CET_time.strftime("%d/%m/%Y %H:%M:%S")
|
||||||
|
last_updates['forex'] = forex_time
|
||||||
|
|
||||||
|
NY_time = datetime.now(NY_zone).replace(tzinfo=None)
|
||||||
#stocks
|
#stocks
|
||||||
stock_time = datetime.strptime(last_updates['stocks'], "%d/%m/%Y %H:%M:%S")
|
stock_time = datetime.strptime(last_updates['stocks'], "%d/%m/%Y %H:%M:%S")
|
||||||
stock_frequency = update_frequencies['stocks']
|
stock_frequency = update_frequencies['stocks']
|
||||||
|
@@ -29,12 +29,14 @@ import sys
|
|||||||
|
|
||||||
|
|
||||||
#api_caller = pexpect.spawn("sudo -E taskset -c 3 python3 api_caller.py")
|
#api_caller = pexpect.spawn("sudo -E taskset -c 3 python3 api_caller.py")
|
||||||
api_caller = pexpect.spawn("sudo -E taskset -c 3 python3 database_caller.py")
|
api_caller = pexpect.spawn("sudo -E python3 database_caller.py")
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
|
|
||||||
|
|
||||||
api_caller.sendline('A')
|
api_caller.sendline('A')
|
||||||
|
|
||||||
os.system("sudo ./check_update.sh")
|
|
||||||
|
#os.system("sudo ./check_update.sh")
|
||||||
|
|
||||||
displaying_screensaver = False
|
displaying_screensaver = False
|
||||||
uploading = False
|
uploading = False
|
||||||
|
Reference in New Issue
Block a user