mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
fix: return invalidate promises and parallelize invalidations
This commit is contained in:
@ -193,14 +193,16 @@ export const useToolSelectorState = ({
|
||||
}, [value, onSelect])
|
||||
|
||||
const handleInstall = useCallback(async () => {
|
||||
const invalidateBuiltinPromise = invalidateAllBuiltinTools()
|
||||
const invalidateInstalledPromise = invalidateInstalledPluginList()
|
||||
try {
|
||||
await invalidateAllBuiltinTools()
|
||||
await invalidateBuiltinPromise
|
||||
}
|
||||
catch (error) {
|
||||
console.error('Failed to invalidate built-in tools cache', error)
|
||||
}
|
||||
try {
|
||||
await invalidateInstalledPluginList()
|
||||
await invalidateInstalledPromise
|
||||
}
|
||||
catch (error) {
|
||||
console.error('Failed to invalidate installed plugin list cache', error)
|
||||
|
||||
Reference in New Issue
Block a user