mirror of
https://github.com/RhenCloud/Cloud-Index.git
synced 2025-12-06 15:26:10 +08:00
feat: 添加对 Microsoft Onedrive 储存支持的 TODO 项目
refactor: 优化 STORAGE_TYPE 环境变量的处理逻辑
This commit is contained in:
@@ -29,9 +29,15 @@ class StorageFactory:
|
||||
if cls._instance is not None:
|
||||
return cls._instance
|
||||
|
||||
storage_type = os.getenv(
|
||||
"STORAGE_TYPE",
|
||||
).lower()
|
||||
storage_type = os.getenv("STORAGE_TYPE")
|
||||
|
||||
if not storage_type:
|
||||
raise RuntimeError(
|
||||
"STORAGE_TYPE environment variable is not set. "
|
||||
"Supported types: r2, github"
|
||||
)
|
||||
|
||||
storage_type = storage_type.lower()
|
||||
|
||||
if storage_type == "r2":
|
||||
cls._instance = R2Storage()
|
||||
|
||||
Reference in New Issue
Block a user