fix(storage): ensure storage_runner initialization within app context (#9627)
This commit is contained in:
parent
b14d59e977
commit
e8abbe0623
1 changed files with 2 additions and 1 deletions
|
|
@ -15,7 +15,8 @@ class Storage:
|
|||
|
||||
def init_app(self, app: Flask):
|
||||
storage_factory = self.get_storage_factory(dify_config.STORAGE_TYPE)
|
||||
self.storage_runner = storage_factory()
|
||||
with app.app_context():
|
||||
self.storage_runner = storage_factory()
|
||||
|
||||
@staticmethod
|
||||
def get_storage_factory(storage_type: str) -> type[BaseStorage]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue