def info(job_id): with session_query() as session: job = Job.load(job_id, session) frontend_scan_id = job.scan.scan_id filename = job.filename probe = job.probename return (frontend_scan_id, filename, probe)
def _finish(job_id, status): with session_transaction() as session: job = Job.load(job_id, session) job.status = status job.ts_end = timestamp() job.update(['status', 'ts_end'], session) scan_id = job.scan.id scanctrl.check_finished(scan_id)
def duration(job_id): with session_query() as session: job = Job.load(job_id, session) return (job.ts_end - job.ts_start)
def set_taskid(job_id, task_id): with session_transaction() as session: job = Job.load(job_id, session) job.task_id = task_id