mirror of
https://github.com/open-webui/open-webui
synced 2025-01-19 09:16:44 +00:00
add function to retrieve the storage provider so it can be easily tested
This commit is contained in:
parent
0129255478
commit
dd16c3d5c1
@ -138,9 +138,14 @@ class S3StorageProvider(StorageProvider):
|
||||
LocalStorageProvider.delete_all_files()
|
||||
|
||||
|
||||
if STORAGE_PROVIDER == "local":
|
||||
def get_storage_provider(storage_provider: str):
|
||||
if storage_provider == "local":
|
||||
Storage = LocalStorageProvider()
|
||||
elif STORAGE_PROVIDER == "s3":
|
||||
elif storage_provider == "s3":
|
||||
Storage = S3StorageProvider()
|
||||
else:
|
||||
raise RuntimeError(f"Unsupported storage provider: {STORAGE_PROVIDER}")
|
||||
raise RuntimeError(f"Unsupported storage provider: {storage_provider}")
|
||||
return Storage
|
||||
|
||||
|
||||
Storage = get_storage_provider(STORAGE_PROVIDER)
|
||||
|
Loading…
Reference in New Issue
Block a user