def refresh_all_states(): indices = IndexSet() for index in indices: logger.debug(u"Rebuilding state for {}".format(index.title)) try: VersionState(index).refresh() except Exception as e: logger.warning(u"Got exception rebuilding state for {}: {}".format(index.title, e)) library.rebuild_toc()
def refresh_all_states(): indices = IndexSet() for index in indices: logger.debug(u"Rebuilding state for {}".format(index.title)) try: if index.is_commentary(): c_re = "^{} on ".format(index.title) texts = VersionSet({"title": {"$regex": c_re}}).distinct("title") for text in texts: VersionState(text).refresh() else: VersionState(index).refresh() except Exception as e: logger.warning(u"Got exception rebuilding state for {}: {}".format(index.title, e)) library.rebuild_toc()
def refresh_all_states(): indices = IndexSet() for index in indices: logger.debug(u"Rebuilding state for {}".format(index.title)) try: if index.is_commentary(): c_re = "^{} on ".format(index.title) texts = VersionSet({ "title": { "$regex": c_re } }).distinct("title") for text in texts: VersionState(text).refresh() else: VersionState(index).refresh() except Exception as e: logger.warning(u"Got exception rebuilding state for {}: {}".format( index.title, e)) library.rebuild_toc()