mirror of https://github.com/langgenius/dify.git
The `Account._current_tenant` object is loaded by a database session (typically `db.session`) whose lifetime is not aligned with the Account model instance. This misalignment causes a `DetachedInstanceError` to be raised when accessing attributes of `Account._current_tenant` after the original session has been closed. To resolve this issue, we now reload the tenant object with `expire_on_commit=False`, ensuring the tenant remains accessible even after the session is closed. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| _workflow_exc.py | ||
| account.py | ||
| api_based_extension.py | ||
| base.py | ||
| dataset.py | ||
| engine.py | ||
| enums.py | ||
| model.py | ||
| provider.py | ||
| source.py | ||
| task.py | ||
| tools.py | ||
| types.py | ||
| web.py | ||
| workflow.py | ||