time.sleep(5) continue else: break sys.exit(0) ## We need to flush the decoder: if time.time() - last_time > config.timeout: print "Flushing reassembler" processor.flush() last_time = time.time() print "%s: Sleeping for %s seconds" % (time.ctime(), config.sleep) time.sleep(config.sleep) def finish(): print "Loader Process size increased above threashold. Exiting and restarting." processor.flush() os._exit(0) ## Run the main loader under the nanny import os r, w = os.pipe() Farm.nanny(run, keepalive=r) while 1: print "Waiting" time.sleep(10)
row = pdbh.fetch() if row and row['c'] >0: time.sleep(5) continue else: break sys.exit(0) ## We need to flush the decoder: if time.time() - last_time > config.timeout: print "Flushing reassembler" processor.flush() last_time = time.time() print "%s: Sleeping for %s seconds" % (time.ctime(), config.sleep) time.sleep(config.sleep) def finish(): print "Loader Process size increased above threashold. Exiting and restarting." processor.flush() os._exit(0) ## Run the main loader under the nanny import os r,w = os.pipe() Farm.nanny(run, keepalive=r) while 1: print "Waiting" time.sleep(10)