database testing

This commit is contained in:
Neythen Treloar
2022-03-05 15:35:56 +00:00
parent c53038b8ed
commit b6646f60cb
4 changed files with 748 additions and 21 deletions

View File

@@ -26,6 +26,8 @@ def getInput(Block=False):
else:
msg = ''
return msg
def emptyInfo(symbols, stock_info):
update = False
@@ -217,6 +219,7 @@ def updateCrypto():
logf.write('. type: ' + str(exc_type))
logf.write('\n ' + "".join(traceback.format_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])))
def updateForex():
@@ -657,7 +660,7 @@ if __name__ == '__main__':
newsapi = NewsApiClient(api_key='cf08652bd17647b89aaf469a1a8198a9')
update_frequencies = {'stocks':2, 'crypto':10, 'news':120, 'weather': 120, 'sports': 120} #minutes
update_frequencies = {'stocks':2, 'crypto':1, 'news':120, 'weather': 120, 'sports': 120} #minutes
NY_zone = pytz.timezone('America/New_York')
CET_zone = pytz.timezone('Europe/Berlin')
@@ -753,7 +756,7 @@ if __name__ == '__main__':
# update if last update was before the previous days closing
forex_time = datetime.strptime(last_updates['forex'], "%d/%m/%Y %H:%M:%S")
CET_time = datetime.now(CET_zone)
CET_time = datetime.now(CET_zone).replace(tzinfo=None)
yday_update = (CET_time.replace(hour=17, minute=00, second=0, microsecond=0) - dt.timedelta(days=1)).replace(tzinfo=None)
if forex_time < yday_update or msg == 'f':