From 2c6f88ef82f7bb60398ec81c58f9d6e4c07806a2 Mon Sep 17 00:00:00 2001 From: Joel Date: Fri, 18 Jul 2025 14:40:57 +0800 Subject: [PATCH] chore: reload vars --- .../rag-pipeline/hooks/use-pipeline-run.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/web/app/components/rag-pipeline/hooks/use-pipeline-run.ts b/web/app/components/rag-pipeline/hooks/use-pipeline-run.ts index 056dcbe909..4ed8cb95c7 100644 --- a/web/app/components/rag-pipeline/hooks/use-pipeline-run.ts +++ b/web/app/components/rag-pipeline/hooks/use-pipeline-run.ts @@ -4,7 +4,7 @@ import { useStoreApi, } from 'reactflow' import produce from 'immer' -import { useWorkflowStore } from '@/app/components/workflow/store' +import { useStore, useWorkflowStore } from '@/app/components/workflow/store' import { WorkflowRunningStatus } from '@/app/components/workflow/types' import { useWorkflowUpdate } from '@/app/components/workflow/hooks/use-workflow-interactions' import { useWorkflowRunEvent } from '@/app/components/workflow/hooks/use-workflow-run-event/use-workflow-run-event' @@ -13,6 +13,9 @@ import { ssePost } from '@/service/base' import { stopWorkflowRun } from '@/service/workflow' import type { VersionHistory } from '@/types/workflow' import { useNodesSyncDraft } from './use-nodes-sync-draft' +import { useSetWorkflowVarsWithValue } from '@/app/components/workflow/hooks/use-fetch-workflow-inspect-vars' +import { useInvalidAllLastRun } from '@/service/use-workflow' +import { FlowType } from '@/types/common' export const usePipelineRun = () => { const store = useStoreApi() @@ -86,6 +89,13 @@ export const usePipelineRun = () => { } }, [handleUpdateWorkflowCanvas, workflowStore]) + const pipelineId = useStore(s => s.pipelineId) + const invalidAllLastRun = useInvalidAllLastRun(FlowType.ragPipeline, pipelineId) + const { fetchInspectVars } = useSetWorkflowVarsWithValue({ + flowType: FlowType.ragPipeline, + flowId: pipelineId!, + }) + const handleRun = useCallback(async ( params: any, callback?: IOtherOptions, @@ -155,6 +165,8 @@ export const usePipelineRun = () => { }, onWorkflowFinished: (params) => { handleWorkflowFinished(params) + fetchInspectVars() + invalidAllLastRun() if (onWorkflowFinished) onWorkflowFinished(params)