def filter_class_ids():
"""Wrapper to avoid importing storage_plugin_manager at module scope (it
requires DB to construct itself) so that this module can be imported
for e.g. building docs without a database.
Return a list of storage resource class IDs which are valid for display (i.e.
those for which we have a plugin available in this process)
"""
from psycopg2 import OperationalError
from django.db.utils import DatabaseError
try:
from chroma_core.lib.storage_plugin.manager import storage_plugin_manager
return storage_plugin_manager.resource_class_id_to_class.keys()
except (OperationalError, DatabaseError):
# OperationalError if the DB server can't be contacted
# DatabaseError if the DB exists but isn't populated
return []
storage_resource_class.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录