def clean_old_jobs():
 serv = _get_serv(ret=None)
 living_jids = set(serv.keys('load:*'))
 to_remove = []
 for ret_key in serv.keys('ret:*'):
  load_key = ret_key.replace('ret:', 'load:', 1)
  if (load_key not in living_jids):
   to_remove.append(ret_key)
 if (len(to_remove) != 0):
  serv.delete(*to_remove)

def clean_old_jobs ( ) : serv = _get_serv ( ret = None ) living_jids = set ( serv . keys ( 'load:*' ) ) to_remove = [ ] for ret_key in serv . keys ( 'ret:*' ) : load_key = ret_key . replace ( 'ret:' , 'load:' , 1 ) if ( load_key not in living_jids ) : to_remove . append ( ret_key ) if ( len ( to_remove ) != 0 ) : serv . delete ( * to_remove )
clean out the old jobs from the job cache .