mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 12:37:20 +08:00
fix: plugin task
This commit is contained in:
parent
3f2baf0131
commit
35eafd239d
@ -9,6 +9,7 @@ import type {
|
|||||||
PluginsFromMarketplaceResponse,
|
PluginsFromMarketplaceResponse,
|
||||||
uploadGitHubResponse,
|
uploadGitHubResponse,
|
||||||
} from '@/app/components/plugins/types'
|
} from '@/app/components/plugins/types'
|
||||||
|
import { TaskStatus } from '@/app/components/plugins/types'
|
||||||
import type {
|
import type {
|
||||||
PluginsSearchParams,
|
PluginsSearchParams,
|
||||||
} from '@/app/components/plugins/marketplace/types'
|
} from '@/app/components/plugins/marketplace/types'
|
||||||
@ -217,14 +218,14 @@ export const usePluginTaskList = () => {
|
|||||||
queryKey: usePluginTaskListKey,
|
queryKey: usePluginTaskListKey,
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const currentData = await get<{ tasks: PluginTask[] }>('/workspaces/current/plugin/tasks?page=1&page_size=100')
|
const currentData = await get<{ tasks: PluginTask[] }>('/workspaces/current/plugin/tasks?page=1&page_size=100')
|
||||||
const taskDone = currentData.tasks.every(task => task.total_plugins === task.completed_plugins)
|
const taskDone = currentData.tasks.every(task => task.status === TaskStatus.success)
|
||||||
|
|
||||||
if (taskDone)
|
if (taskDone)
|
||||||
setEnabled(false)
|
setEnabled(false)
|
||||||
|
|
||||||
return currentData
|
return currentData
|
||||||
},
|
},
|
||||||
// refetchInterval: 5000,
|
refetchInterval: 5000,
|
||||||
enabled,
|
enabled,
|
||||||
})
|
})
|
||||||
const handleRefetch = useCallback(() => {
|
const handleRefetch = useCallback(() => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user