MCPcopy Create free account
hub / github.com/langgenius/dify / reload

Function reload

packages/dev-proxy/src/cli.ts:64–77  ·  view source on GitHub ↗
(nextConfig: unknown, reason: string)

Source from the content-addressed store, hash-verified

62 console.log(`[dev-proxy] listening on http://${runtime.host}:${runtime.port}`)
63
64 const reload = async (nextConfig: unknown, reason: string) => {
65 assertDevProxyConfig(nextConfig)
66 const nextServerOptions = resolveDevProxyServerOptions(nextConfig.server, cliOptions)
67
68 if (runtime.host === nextServerOptions.host && runtime.port === nextServerOptions.port) {
69 runtime.updateConfig(nextConfig)
70 console.log(`[dev-proxy] reloaded ${reason}`)
71 return
72 }
73
74 await closeServer(runtime.server)
75 runtime = startDevProxyServer(nextConfig, cliOptions)
76 console.log(`[dev-proxy] restarted on http://${runtime.host}:${runtime.port} after ${reason}`)
77 }
78
79 const enqueueReload = (loadConfig: () => Promise<unknown> | unknown, reason: string) => {
80 reloadTask = reloadTask.then(async () => {

Callers 1

enqueueReloadFunction · 0.85

Calls 5

assertDevProxyConfigFunction · 0.90
closeServerFunction · 0.85
startDevProxyServerFunction · 0.85
logMethod · 0.45

Tested by

no test coverage detected