def set_counts_flag(title, flag, val): """ Set a flag on the counts doc for title. """ flag = "flags.%s" % flag db.counts.update({"title": title}, {"$set": {flag: val}}) delete_template_cache("texts_dashboard")
def save_toc(toc): """ Saves the table of contents object to in-memory cache, invalidtes texts_list cache. """ scache.set_cache_elem('toc_cache', toc, 600000) scache.delete_template_cache("texts_list") scache.delete_template_cache("texts_dashboard")
def delete_orphaned_counts(request): remove_old_counts() scache.delete_template_cache("texts_dashboard") if MULTISERVER_ENABLED: server_coordinator.publish_event("scache", "delete_template_cache", ["texts_dashboard"]) return HttpResponseRedirect("/dashboard?m=Orphaned-counts-deleted")
def save_toc(toc): """ Saves the table of contents object to in-memory cache, invalidtes texts_list cache. """ scache.set_cache_elem('toc_cache', toc, 600000) scache.delete_template_cache("texts_list") scache.delete_template_cache("texts_dashboard") library.local_cache.pop("category_id_dict", None)
def set_flag(self, flag, value): self.flags[flag] = value # could use mongo level $set to avoid doc load, for speedup delete_template_cache("texts_dashboard") return self
def delete_orphaned_counts(request): remove_old_counts() scache.delete_template_cache("texts_dashboard") return HttpResponseRedirect("/dashboard?m=Orphaned-counts-deleted")