def _compute_cache_for_person(person_id):
    start = time()
    if not FORCE_CACHE_IS_EXPIRED:
        expire_all_cache_for_person(person_id)
    f_to_call = [(get_pubs, ), (get_person_names_dicts, ),
                 (get_veryfy_my_pubs_list_link, ), (get_rec_query, ),
                 (get_collabtuples, ),
                 (get_coauthors, ), (get_institute_pubs, ),
                 (get_pubs_per_year, ), (get_total_downloads, ),
                 (get_kwtuples, ), (get_fieldtuples, ), (get_hepnames_data, ),
                 (get_summarize_records, ), (get_self_pubs, ),
                 (get_internal_publications, ), (get_external_publications, ),
                 (get_datasets, )]

    waited = 0
    for f in f_to_call:
        r = [None, False]
        failures_delay = 0.01
        while not r[1]:
            if len(f) < 2:
                r = f[0](person_id)
            else:
                r = f[0](person_id, *f[1])
            #print str(f), r[1]
            if not r[1]:
                sleep(failures_delay)
                failures_delay *= 1.05
                waited += 1
                #print 'Waiting for ', str(f)
    #print 'Waited ', waited, ' ', failures_delay

    print person_id, ',', str(time() - start)
def _compute_cache_for_person(person_id):
    start = time.time()
    expire_all_cache_for_person(person_id)
    _ = get_rec_query(person_id)
    _ = get_pubs(person_id)
    _ = get_self_pubs(person_id)
    _ = get_institute_pub_dict(person_id)
    _ = get_person_names_dicts(person_id)
    _ = get_total_downloads(person_id)
    _ = get_veryfy_my_pubs_list_link(person_id)
    _ = get_cited_by_list(person_id)
    _ = get_kwtuples(person_id)
    _ = get_venuetuples(person_id)
    _ = get_collabtuples(person_id)
    _ = get_coauthors(person_id)
    _ = get_summarize_records(person_id, 'hcs', 'en')
    _ = get_hepnames_data(person_id)
    print person_id, ',' , str(time.time() - start)
def _compute_cache_for_person(person_id):
    start = time.time()
    expire_all_cache_for_person(person_id)
    _ = get_rec_query(person_id)
    _ = get_pubs(person_id)
    _ = get_self_pubs(person_id)
    _ = get_institute_pub_dict(person_id)
    _ = get_person_names_dicts(person_id)
    _ = get_total_downloads(person_id)
    _ = get_veryfy_my_pubs_list_link(person_id)
    _ = get_cited_by_list(person_id)
    _ = get_kwtuples(person_id)
    _ = get_venuetuples(person_id)
    _ = get_collabtuples(person_id)
    _ = get_coauthors(person_id)
    _ = get_summarize_records(person_id, 'hcs', 'en')
    _ = get_hepnames_data(person_id)
    print person_id, ',' , str(time.time() - start)
def _compute_cache_for_person(person_id):
    start = time()
    if not FORCE_CACHE_IS_EXPIRED:
        expire_all_cache_for_person(person_id)
    f_to_call = [
               (get_pubs,),
               (get_person_names_dicts,),
               (get_veryfy_my_pubs_list_link,),
               (get_rec_query,),
               (get_collabtuples,),
               (get_coauthors,),
               (get_institute_pubs,),
               (get_pubs_per_year,),
               (get_total_downloads,),
               (get_kwtuples,),
               (get_fieldtuples,),
               (get_hepnames_data,),
               (get_summarize_records,),
               (get_self_pubs,),
               (get_internal_publications,),
               (get_external_publications,),
               (get_datasets,)
                ]

    waited = 0
    for f in f_to_call:
        r = [None, False]
        failures_delay = 0.01
        while not r[1]:
            if len(f) < 2:
                r = f[0](person_id)
            else:
                r = f[0](person_id, *f[1])
            #print str(f), r[1]
            if not r[1]:
                sleep(failures_delay)
                failures_delay *= 1.05
                waited += 1
                #print 'Waiting for ', str(f)
    #print 'Waited ', waited, ' ', failures_delay

    print person_id, ',' , str(time() - start)
def expire_caches_for_person(person_id):
    ''' Expires all caches for personid. '''
    expire_all_cache_for_person(person_id)
def expire_caches_for_person(person_id):
    ''' Expires all caches for personid. '''
    expire_all_cache_for_person(person_id)
def expire_caches_for_person(person_id):
    """
    Expires all caches for personid.
    """

    expire_all_cache_for_person(person_id)
def expire_caches_for_person(person_id):
    """
    Expires all caches for personid.
    """

    expire_all_cache_for_person(person_id)