def update_cache(): global cache try: cache = { 'meta': dbo.meta_cache(), 'plugins': dbo.plugin_cache(), 'categories': dbo.category_cache(), } except: dbo.update() update_cache()
def update(load_type='speedy'): response.headers['Content-Type'] = 'application/json' if request['REMOTE_ADDR'] == '127.0.0.1': conf = config.Configuration() if load_type == 'full': speedy = False else: speedy = True resp = dbo.update(speedy) update_cache() return json.dumps(resp, sort_keys=True, indent=4)