Update database_caller.py
This commit is contained in:
@@ -1148,6 +1148,24 @@ if __name__ == '__main__':
|
|||||||
update_process.start()
|
update_process.start()
|
||||||
update_processes.append(update_process)
|
update_processes.append(update_process)
|
||||||
|
|
||||||
|
|
||||||
|
# ipos
|
||||||
|
ipo_time = datetime.strptime(last_updates['ipo']['time'], "%d/%m/%Y %H:%M:%S")
|
||||||
|
|
||||||
|
|
||||||
|
NY_time = datetime.now(NY_zone).replace(tzinfo=None)
|
||||||
|
diff = (NY_time - ipo_time).total_seconds()/60 #minutes
|
||||||
|
|
||||||
|
|
||||||
|
if last_updates['ipo']['force'] or diff >= update_frequencies['ipo']:
|
||||||
|
ipo_time = NY_time.strftime("%d/%m/%Y %H:%M:%S")
|
||||||
|
last_updates['ipo']['time'] = ipo_time
|
||||||
|
last_updates['ipo']['force'] = False
|
||||||
|
update_process = Process(target = updateIpo, args = (ipo_key,logf))
|
||||||
|
update_process.start()
|
||||||
|
update_processes.append(update_process)
|
||||||
|
|
||||||
|
|
||||||
# weather
|
# weather
|
||||||
weather_time = datetime.strptime(last_updates['weather']['time'], "%d/%m/%Y %H:%M:%S")
|
weather_time = datetime.strptime(last_updates['weather']['time'], "%d/%m/%Y %H:%M:%S")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user