refactor: human input node decouple db (#32900)

This commit is contained in:
wangxiaolei
2026-03-04 13:18:32 +08:00
committed by GitHub
parent b584434e28
commit e14b09d4db
12 changed files with 69 additions and 58 deletions

View File

@ -130,7 +130,7 @@ class HumanInputService:
if isinstance(session_factory, Engine):
session_factory = sessionmaker(bind=session_factory)
self._session_factory = session_factory
self._form_repository = form_repository or HumanInputFormSubmissionRepository(session_factory)
self._form_repository = form_repository or HumanInputFormSubmissionRepository()
def get_form_by_token(self, form_token: str) -> Form | None:
record = self._form_repository.get_by_token(form_token)

View File

@ -1015,7 +1015,7 @@ class WorkflowService:
rendered_content: str,
resolved_default_values: Mapping[str, Any],
) -> tuple[str, list[DeliveryTestEmailRecipient]]:
repo = HumanInputFormRepositoryImpl(session_factory=db.engine, tenant_id=app_model.tenant_id)
repo = HumanInputFormRepositoryImpl(tenant_id=app_model.tenant_id)
params = FormCreateParams(
app_id=app_model.id,
workflow_execution_id=None,
@ -1081,6 +1081,7 @@ class WorkflowService:
config=node_config,
graph_init_params=graph_init_params,
graph_runtime_state=graph_runtime_state,
form_repository=HumanInputFormRepositoryImpl(tenant_id=workflow.tenant_id),
)
return node