Пример #1
0
def index():
    _cache_key = 'view/%s/get_data' % (request.path)

    @cache.cached(key_prefix=_cache_key)
    def get_data():
        indexmon.refresh(True)
        return indexmon.get_data()

    if indexmon.refreshed_flag:
        cache.delete(_cache_key)
        indexmon.refreshed_flag = False
    return render_template('index.html', **get_data())
Пример #2
0
def index():
    _cache_key = 'view/%s/get_data' % (request.path)

    @cache.cached(key_prefix=_cache_key)
    def get_data():
        indexmon.refresh(True)
        return indexmon.get_data()

    if indexmon.refreshed_flag:
        cache.delete(_cache_key)
        # make sure cached hashes for ui.hashes are cleared
        cache.delete_memoized(hashes)
        indexmon.refreshed_flag = False
    return render_template('index.html', **get_data())