예제 #1
0
 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)
예제 #2
0
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)
예제 #3
0
파일: hat.py 프로젝트: xuldor/pypilot
 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)
예제 #4
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')
         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)