From aa5b6241c97ebe1154eca2081b88dbe017cbac80 Mon Sep 17 00:00:00 2001 From: "Krzysztof A. Adamski" Date: Wed, 4 Jun 2008 17:35:16 -0400 Subject: Jobthing status codes cleanup. --- func/jobthing.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'func') diff --git a/func/jobthing.py b/func/jobthing.py index ea8d92c..77a73fb 100644 --- a/func/jobthing.py +++ b/func/jobthing.py @@ -27,9 +27,8 @@ import utils JOB_ID_RUNNING = 0 JOB_ID_FINISHED = 1 JOB_ID_LOST_IN_SPACE = 2 -JOB_ID_ASYNC_PARTIAL = 3 -JOB_ID_ASYNC_FINISHED = 4 -JOB_ID_REMOTE_ERROR = 5 +JOB_ID_PARTIAL = 3 +JOB_ID_REMOTE_ERROR = 4 # how long to retain old job records in the job id database RETAIN_INTERVAL = 60 * 60 @@ -123,7 +122,7 @@ def batch_run(pool, callback, nforks): results = forkbomb.batch_run(pool, callback, nforks) # we now have a list of job id's for each minion, kill the task - __update_status(job_id, JOB_ID_ASYNC_PARTIAL, results) + __update_status(job_id, JOB_ID_PARTIAL, results) sys.exit(0) def minion_async_run(retriever, method, args): @@ -161,13 +160,13 @@ def job_status(jobid, client_class=None): got_status = __get_status(jobid) - # if the status comes back as JOB_ID_ASYNC_PARTIAL what we have is actually a hash + # if the status comes back as JOB_ID_PARTIAL what we have is actually a hash # of hostname/minion-jobid pairs. Instantiate a client handle for each and poll them # for their actual status, filling in only the ones that are actually done. (interim_rc, interim_results) = got_status - if interim_rc == JOB_ID_ASYNC_PARTIAL: + if interim_rc == JOB_ID_PARTIAL: partial_results = {} @@ -194,9 +193,9 @@ def job_status(jobid, client_class=None): some_missing = True if some_missing: - return (JOB_ID_ASYNC_PARTIAL, partial_results) + return (JOB_ID_PARTIAL, partial_results) else: - return (JOB_ID_ASYNC_FINISHED, partial_results) + return (JOB_ID_FINISHED, partial_results) else: return got_status -- cgit