mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-05 14:40:43 +08:00
chore: handle lastrun run retry
This commit is contained in:
parent
2c4ea612a7
commit
650abe8a8f
@ -139,7 +139,6 @@ const BasePanel: FC<BasePanelProps> = ({
|
||||
|
||||
const {
|
||||
isShowSingleRun,
|
||||
showSingleRun,
|
||||
hideSingleRun,
|
||||
runningStatus,
|
||||
handleStop,
|
||||
|
@ -30,9 +30,9 @@ const LastRun: FC<Props> = ({
|
||||
...otherResultPanelProps
|
||||
}) => {
|
||||
const isRunning = oneStepRunRunningStatus === NodeRunningStatus.Running
|
||||
// const isOneStepRunSuccess = oneStepRunRunningStatus === NodeRunningStatus.Succeeded
|
||||
const isOneStepRunFailed = oneStepRunRunningStatus === NodeRunningStatus.Failed
|
||||
const { data: lastRunResult, isFetching } = useLastRun(appId, nodeId, !isOneStepRunFailed)
|
||||
const { data: lastRunResult, isFetching, error } = useLastRun(appId, nodeId, !isOneStepRunFailed)
|
||||
const noLastRun = (error as any)?.status === 404
|
||||
const runResult = (isOneStepRunFailed ? singleRunResult : lastRunResult) || {}
|
||||
|
||||
if (isFetching) {
|
||||
@ -45,7 +45,7 @@ const LastRun: FC<Props> = ({
|
||||
if (isRunning)
|
||||
return <ResultPanel status='running' showSteps={false} />
|
||||
|
||||
if (!runResult) {
|
||||
if (noLastRun || !runResult) {
|
||||
return (
|
||||
<NoData canSingleRun={canSingleRun} onSingleRun={onSingleRunClicked} />
|
||||
)
|
||||
|
@ -94,8 +94,11 @@ export const useLastRun = (appID: string, nodeId: string, enabled: boolean) => {
|
||||
enabled,
|
||||
queryKey: [...useLastRunKey, appID, nodeId],
|
||||
queryFn: async () => {
|
||||
return get(`apps/${appID}/workflows/draft/nodes/${nodeId}/last-run`)
|
||||
return get(`apps/${appID}/workflows/draft/nodes/${nodeId}/last-run`, {}, {
|
||||
silent: true,
|
||||
})
|
||||
},
|
||||
retry: 0,
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user