def precompute_cache_for_person(person_ids=None, all_persons=False, only_expired=False): pids = [] if all_persons: pids = list(get_existing_personids(with_papers_only=True)) elif only_expired: pids = get_expired_person_ids() if person_ids: pids += person_ids for p in pids: _compute_cache_for_person(p)
def precompute_cache_for_person(person_ids=None, all_persons=False, only_expired=False): pids = [] if all_persons: pids = list(get_existing_personids(with_papers_only=True)) elif only_expired: pids = get_expired_person_ids() if person_ids: pids += person_ids for p in pids: _compute_cache_for_person(p)
def multiprocessing_precompute_cache_for_person(person_ids=None, all_persons=False, only_expired=False): pids = [] if all_persons: pids = list(get_existing_personids(with_papers_only=True)) elif only_expired: pids = get_expired_person_ids() if person_ids: pids += person_ids from multiprocessing import Pool p = Pool() p.map(_compute_cache_for_person, pids)
def multiprocessing_precompute_cache_for_person(person_ids=None, all_persons=False, only_expired=False): pids = [] if all_persons: pids = list(get_existing_personids(with_papers_only=True)) elif only_expired: pids = get_expired_person_ids() if person_ids: pids += person_ids from multiprocessing import Pool p = Pool() p.map(_compute_cache_for_person, pids)