code: def _build_cache():
      
      sets = current_oaiserver.sets
      if sets is None:
          # build sets cache
          sets = current_oaiserver.sets = [
              oaiset.spec for oaiset in OAISet.query.filter(
                  OAISet.search_pattern.is_(None)).all()]
      return sets
docs: Build sets cache.