def control_job(self, pk, signal): logging.debug("Analysis queue control_job: %s %s" % (pk, signal)) """Terminate, suspend, or resume a job.""" self.cv.acquire() try: if not self.is_running(pk): ret = (False, "not running") else: a = self.running[pk] fn = {"term": a.terminate, "stop": a.suspend, "cont": a.resume}.get(signal.lower()) if fn is None: ret = (False, "invalid signal") else: ret = (fn(), "executed") finally: self.cv.release() return ret
def control_job(self, pk, signal): logger.debug("Analysis queue control_job: %s %s" % (pk, signal)) """Terminate, suspend, or resume a job.""" self.cv.acquire() try: if not self.is_running(pk): ret = (False, "not running") else: a = self.running[pk] fn = {"term": a.terminate, "stop": a.suspend, "cont": a.resume, }.get(signal.lower()) if fn is None: ret = (False, "invalid signal") else: ret = (fn(), "executed") finally: self.cv.release() return ret
def remove_signal(self, lock_id, signal): res = self.adaptor.remove_signal(lock_id, signal.lower()) return res
def has_signal(self, lock_id, signal): res = self.adaptor.has_signal(lock_id, signal.lower()) return res