mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-11 03:46:52 +08:00
refactor: use dify_config to replace legacy usage of flask app's config (#9089)
This commit is contained in:
@@ -2,24 +2,24 @@ from collections.abc import Generator
|
||||
|
||||
import boto3
|
||||
from botocore.exceptions import ClientError
|
||||
from flask import Flask
|
||||
|
||||
from configs import dify_config
|
||||
from extensions.storage.base_storage import BaseStorage
|
||||
|
||||
|
||||
class OracleOCIStorage(BaseStorage):
|
||||
"""Implementation for Oracle OCI storage."""
|
||||
|
||||
def __init__(self, app: Flask):
|
||||
super().__init__(app)
|
||||
app_config = self.app.config
|
||||
self.bucket_name = app_config.get("OCI_BUCKET_NAME")
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
self.bucket_name = dify_config.OCI_BUCKET_NAME
|
||||
self.client = boto3.client(
|
||||
"s3",
|
||||
aws_secret_access_key=app_config.get("OCI_SECRET_KEY"),
|
||||
aws_access_key_id=app_config.get("OCI_ACCESS_KEY"),
|
||||
endpoint_url=app_config.get("OCI_ENDPOINT"),
|
||||
region_name=app_config.get("OCI_REGION"),
|
||||
aws_secret_access_key=dify_config.OCI_SECRET_KEY,
|
||||
aws_access_key_id=dify_config.OCI_ACCESS_KEY,
|
||||
endpoint_url=dify_config.OCI_ENDPOINT,
|
||||
region_name=dify_config.OCI_REGION,
|
||||
)
|
||||
|
||||
def save(self, filename, data):
|
||||
|
||||
Reference in New Issue
Block a user