従いたいプロセスのフローチャートを作成しましたが、これを実行する方法がわかりません。現時点では、私は以下を持っています。
t1 は、cherrypy ではないデータベース挿入スクリプトです。
def main():
thread = ThreadUrl(queue)
thread = thread()
thread.start()
cherrypy.config.update({'server.socket_host': '0.0.0.0',
'server.socket_port': 2970})
#'server.thread_pool': 100})
queue.join()
cherrypy.engine.start()
while True:
if thread.isAlive():
try:
cherrypy.engine.start()
except Exception:
print ('Started cherrypy already.')
print ('I am alive.')
else:
try:
thread.exit()
except Exception:
print ('Already killed this thread.')
print ('I am dead.')
try:
cherrypy.engine.stop()
except Exception:
print ('Already stopped cherrypy.')
try:
thread.start()
except Exception:
print (sys.exc_info()[1])
if __name__ == '__main__':
main()