Exemple #1
0
def get_done_data():
    cache = get_the_cache()
    done_data = cache.get('medleydash-done')
    updated_at = cache.get('medleydash-done-updated')
    if not done_data:
        connection = login(email, password)
        done_data = fetch_done_data(connection)
        cache.set('medleydash-done', done_data, timeout=5 * 60)
        updated_at = datetime.datetime.now()
        cache.set('medleydash-done-updated', updated_at, timeout=5 * 60)
    return done_data, updated_at
Exemple #2
0
def get_wip_data():
    cache = get_the_cache()
    wip_data = cache.get('medleydash-wip')
    updated_at = cache.get('medleydash-wip-updated')
    if not wip_data:
        connection = login(email, password)
        wip_data = fetch_wip_data(connection)
        cache.set('medleydash-wip', wip_data, timeout=5 * 60)
        updated_at = datetime.datetime.now()
        cache.set('medleydash-wip-updated', updated_at, timeout=5 * 60)
    return wip_data, updated_at
Exemple #3
0
def get_metrics_data():
    cache = get_the_cache()
    feature_data = cache.get('medleydash-features')
    updated_at = cache.get('medleydash-features-updated')
    if not feature_data:
        connection = login(email, password)
        feature_data = fetch_feature_data(connection)
        cache.set('medleydash-features', feature_data, timeout=5 * 60)
        updated_at = datetime.datetime.now()
        cache.set('medleydash-features-updated', updated_at, timeout=5 * 60)
    return feature_data, updated_at
Exemple #4
0
def get_done_data():
    cache = get_the_cache()
    done_data = cache.get('medleydash-done')
    updated_at = cache.get('medleydash-done-updated')
    if not done_data:
        connection = login(email, password)
        done_data = fetch_done_data(connection)
        cache.set('medleydash-done', done_data, timeout=5 * 60)
        updated_at = datetime.datetime.now()
        cache.set('medleydash-done-updated', updated_at,
                   timeout=5 * 60)
    return done_data, updated_at
Exemple #5
0
def get_wip_data():
    cache = get_the_cache()
    wip_data = cache.get('medleydash-wip')
    updated_at = cache.get('medleydash-wip-updated')
    if not wip_data:
        connection = login(email, password)
        wip_data = fetch_wip_data(connection)
        cache.set('medleydash-wip', wip_data, timeout=5 * 60)
        updated_at = datetime.datetime.now()
        cache.set('medleydash-wip-updated', updated_at,
                   timeout=5 * 60)
    return wip_data, updated_at
Exemple #6
0
def get_metrics_data():
    cache = get_the_cache()
    feature_data = cache.get('medleydash-features')
    updated_at = cache.get('medleydash-features-updated')
    if not feature_data:
        connection = login(email, password)
        feature_data = fetch_feature_data(connection)
        cache.set('medleydash-features', feature_data, timeout=5 * 60)
        updated_at = datetime.datetime.now()
        cache.set('medleydash-features-updated', updated_at,
                   timeout=5 * 60)
    return feature_data, updated_at