Commit 57e7b1ed authored by Aaron R Poulter-martinez's avatar Aaron R Poulter-martinez
Browse files

changed code from creating new thread to creating new process

parent b83c2302
...@@ -6,6 +6,7 @@ from flask import render_template ...@@ -6,6 +6,7 @@ from flask import render_template
# app imports # app imports
from appmethods import update_both_dbs, run_schedule_loop from appmethods import update_both_dbs, run_schedule_loop
from redisactions import redisdb from redisactions import redisdb
from multiprocessing import Process
# python imports # python imports
import json import json
...@@ -45,13 +46,18 @@ def get_last_update(): ...@@ -45,13 +46,18 @@ def get_last_update():
return resp return resp
# make sure the cacheing is set up on init
update_both_dbs()
# make sure the cacheing is set up on init
try: try:
thread.start_new_thread(run_schedule_loop, ()) pUpdate = Process(target = update_both_dbs, args = ())
print "started thread!" pSchedule = Process(target = run_schedule_loop, args = ())
except: pSchedule.start()
pUpdate.start()
print("Process Started!")
except Exception as e:
print(e)
print "===================================================" \ print "===================================================" \
+ "Unable to start scheduling thread" \ + "Unable to start scheduling thread" \
+ "===================================================" + traceback.print_exc(file=sys.stdout) \
+ "==================================================="
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment