import os os.environ["MEGA_LOAD_STUDIES"] = 0 import sys import time from MEGA import sql tmpDir = sys.argv[1] while True: jobId = sql.getWork() if jobId: try: os.system("python doWork.py %d %s" % (jobId, tmpDir)) sql.killJob(jobId) except: pass else: time.sleep(10)
#!/usr/bin/python import argparse from MEGA import sql parser = argparse.ArgumentParser() parser.add_argument("job", help="Job to be killed") args = parser.parse_args() sql.killJob(args.job)