diff options
author | makkalot <makkalot@gmail.com> | 2008-07-28 10:51:29 +0300 |
---|---|---|
committer | makkalot <makkalot@gmail.com> | 2008-07-28 10:51:29 +0300 |
commit | 74caef14d905273360aeacd40695c836ef238685 (patch) | |
tree | 01b838d246bc2d7b220799e31845c93a7e773c18 /func/jobthing.py | |
parent | 364d17a19282f1b8f22e561b396fdbc9983861ac (diff) | |
download | func-74caef14d905273360aeacd40695c836ef238685.tar.gz func-74caef14d905273360aeacd40695c836ef238685.tar.xz func-74caef14d905273360aeacd40695c836ef238685.zip |
some code to tolerate the old job_ids to not crash the app
Diffstat (limited to 'func/jobthing.py')
-rw-r--r-- | func/jobthing.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/func/jobthing.py b/func/jobthing.py index 06978eb..3b9dc80 100644 --- a/func/jobthing.py +++ b/func/jobthing.py @@ -58,9 +58,9 @@ def __purge_old_jobs(storage): for x in storage.keys(): # minion jobs have "-minion" in the job id so disambiguation so we need to remove that jobkey = x.strip().split('-') - if len(jobkey) == 4: + if len(jobkey) == 4: #the overrlord part for new format job_ids jobkey = jobkey[3] - else: + else: #the minion part job_ids jobkey = jobkey[0] create_time = float(jobkey) @@ -78,7 +78,11 @@ def __get_open_ids(storage): result_hash_pack = {} #print storage for job_id,result in storage.iteritems(): - result_hash_pack[job_id]=result[0] + #TOBE REMOVED that control is for old job_ids + #some users who will upgrade to new version will have errors + #if we dont have that control here :) + if len(job_id.split("-"))==4: #ignore the old job_ids + result_hash_pack[job_id]=result[0] return result_hash_pack |