Revision c061d046 lib/jqueue/__init__.py
b/lib/jqueue/__init__.py | ||
---|---|---|
2290 | 2290 |
return helper(self._GetJobPath(job_id), load_fn, |
2291 | 2291 |
fields, prev_job_info, prev_log_serial, timeout) |
2292 | 2292 |
|
2293 |
def HasJobBeenFinalized(self, job_id): |
|
2294 |
"""Checks if a job has been finalized. |
|
2295 |
|
|
2296 |
@type job_id: int |
|
2297 |
@param job_id: Job identifier |
|
2298 |
@rtype: boolean |
|
2299 |
@return: True if the job has been finalized, |
|
2300 |
False if the timeout has been reached, |
|
2301 |
None if the job doesn't exist |
|
2302 |
|
|
2303 |
""" |
|
2304 |
job = self.SafeLoadJobFromDisk(job_id, True, writable=False) |
|
2305 |
if job is not None: |
|
2306 |
return job.CalcStatus() in constants.JOBS_FINALIZED |
|
2307 |
else: |
|
2308 |
return None |
|
2309 |
|
|
2293 | 2310 |
@locking.ssynchronized(_LOCK) |
2294 | 2311 |
@_RequireOpenQueue |
2295 | 2312 |
def CancelJob(self, job_id): |
Also available in: Unified diff