mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-09 10:56:52 +08:00
refactor: use dify_config to replace legacy usage of flask app's config (#9089)
This commit is contained in:
@@ -1,23 +1,22 @@
|
||||
from collections.abc import Generator
|
||||
|
||||
import tos
|
||||
from flask import Flask
|
||||
|
||||
from configs import dify_config
|
||||
from extensions.storage.base_storage import BaseStorage
|
||||
|
||||
|
||||
class VolcengineTosStorage(BaseStorage):
|
||||
"""Implementation for Volcengine TOS storage."""
|
||||
|
||||
def __init__(self, app: Flask):
|
||||
super().__init__(app)
|
||||
app_config = self.app.config
|
||||
self.bucket_name = app_config.get("VOLCENGINE_TOS_BUCKET_NAME")
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.bucket_name = dify_config.VOLCENGINE_TOS_BUCKET_NAME
|
||||
self.client = tos.TosClientV2(
|
||||
ak=app_config.get("VOLCENGINE_TOS_ACCESS_KEY"),
|
||||
sk=app_config.get("VOLCENGINE_TOS_SECRET_KEY"),
|
||||
endpoint=app_config.get("VOLCENGINE_TOS_ENDPOINT"),
|
||||
region=app_config.get("VOLCENGINE_TOS_REGION"),
|
||||
ak=dify_config.VOLCENGINE_TOS_ACCESS_KEY,
|
||||
sk=dify_config.VOLCENGINE_TOS_SECRET_KEY,
|
||||
endpoint=dify_config.VOLCENGINE_TOS_ENDPOINT,
|
||||
region=dify_config.VOLCENGINE_TOS_REGION,
|
||||
)
|
||||
|
||||
def save(self, filename, data):
|
||||
|
||||
Reference in New Issue
Block a user