def process(pipe, config): while True: time.sleep( 30) # delay loading web and wait until modules are loaded try: import web web.web_process(pipe, config) except Exception as e: print('web failed to run process:', e)
def web_process(pipe, keyspipe, actions): while True: try: import web web.web_process(pipe, keyspipe, actions) except Exception as e: print('failed to run web server:', e) #time.sleep(5) exit(0)
def process(pipe, config): while True: if os.system('sudo chrt -pi 0 %d 2> /dev/null > /dev/null' % os.getpid()): print( 'warning, failed to make hat web process idle, trying renice' ) if os.system("renice 20 %d" % os.getpid()): print('warning, failed to renice hat web process') time.sleep( 30) # delay loading web and wait until modules are loaded try: import web web.web_process(pipe, config) except Exception as e: print('web failed to run process:', e)
def process(pipe, config): while True: if os.system('sudo chrt -pi 0 %d 2> /dev/null > /dev/null' % os.getpid()): print('warning, failed to make hat web process idle, trying renice') if os.system("renice 20 %d" % os.getpid()): print('warning, failed to renice hat web process') if os.getenv('USER') == 'tc': time.sleep(30) # delay loading web and wait until modules are loaded else: time.sleep(3) # delay less on other platforms try: sys.path.append(os.path.dirname(os.path.abspath(__file__))) import web web.web_process(pipe, config) except Exception as e: print('web failed to run process:', e)