mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +00:00
Wrap each init task with error handling (#2187)
This commit is contained in:
@@ -24,6 +24,7 @@ import GlobalToast from '@/components/toast/GlobalToast.vue'
|
|||||||
import TopMenubar from '@/components/topbar/TopMenubar.vue'
|
import TopMenubar from '@/components/topbar/TopMenubar.vue'
|
||||||
import { SERVER_CONFIG_ITEMS } from '@/constants/serverConfig'
|
import { SERVER_CONFIG_ITEMS } from '@/constants/serverConfig'
|
||||||
import { useCoreCommands } from '@/hooks/coreCommandHooks'
|
import { useCoreCommands } from '@/hooks/coreCommandHooks'
|
||||||
|
import { useErrorHandling } from '@/hooks/errorHooks'
|
||||||
import { i18n } from '@/i18n'
|
import { i18n } from '@/i18n'
|
||||||
import { api } from '@/scripts/api'
|
import { api } from '@/scripts/api'
|
||||||
import { app } from '@/scripts/app'
|
import { app } from '@/scripts/app'
|
||||||
@@ -162,29 +163,30 @@ onBeforeUnmount(() => {
|
|||||||
|
|
||||||
useEventListener(window, 'keydown', useKeybindingService().keybindHandler)
|
useEventListener(window, 'keydown', useKeybindingService().keybindHandler)
|
||||||
|
|
||||||
|
const { wrapWithErrorHandling, wrapWithErrorHandlingAsync } = useErrorHandling()
|
||||||
const onGraphReady = () => {
|
const onGraphReady = () => {
|
||||||
requestIdleCallback(
|
requestIdleCallback(
|
||||||
() => {
|
() => {
|
||||||
// Setting values now available after comfyApp.setup.
|
// Setting values now available after comfyApp.setup.
|
||||||
// Load keybindings.
|
// Load keybindings.
|
||||||
useKeybindingService().registerUserKeybindings()
|
wrapWithErrorHandling(useKeybindingService().registerUserKeybindings)()
|
||||||
|
|
||||||
// Load server config
|
// Load server config
|
||||||
useServerConfigStore().loadServerConfig(
|
wrapWithErrorHandling(useServerConfigStore().loadServerConfig)(
|
||||||
SERVER_CONFIG_ITEMS,
|
SERVER_CONFIG_ITEMS,
|
||||||
settingStore.get('Comfy.Server.ServerConfigValues')
|
settingStore.get('Comfy.Server.ServerConfigValues')
|
||||||
)
|
)
|
||||||
|
|
||||||
// Load model folders
|
// Load model folders
|
||||||
useModelStore().loadModelFolders()
|
wrapWithErrorHandlingAsync(useModelStore().loadModelFolders)()
|
||||||
|
|
||||||
|
// Non-blocking load of node frequencies
|
||||||
|
wrapWithErrorHandlingAsync(useNodeFrequencyStore().loadNodeFrequencies)()
|
||||||
|
|
||||||
// Node defs now available after comfyApp.setup.
|
// Node defs now available after comfyApp.setup.
|
||||||
// Explicitly initialize nodeSearchService to avoid indexing delay when
|
// Explicitly initialize nodeSearchService to avoid indexing delay when
|
||||||
// node search is triggered
|
// node search is triggered
|
||||||
useNodeDefStore().nodeSearchService.endsWithFilterStartSequence('')
|
useNodeDefStore().nodeSearchService.endsWithFilterStartSequence('')
|
||||||
|
|
||||||
// Non-blocking load of node frequencies
|
|
||||||
useNodeFrequencyStore().loadNodeFrequencies()
|
|
||||||
},
|
},
|
||||||
{ timeout: 1000 }
|
{ timeout: 1000 }
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user