MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / stop

Function stop

apps/desktop/main/api/index.ts:100–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98}
99
100export async function stop(): Promise<void> {
101 if (!server) return
102
103 try {
104 await server.close()
105 } catch (err) {
106 apiLogger.error('Error closing server', err)
107 } finally {
108 server = null
109 startedAt = null
110 runningPort = null
111 lastError = null
112 apiLogger.info('Server stopped')
113 }
114}
115
116export async function restart(): Promise<void> {
117 await stop()

Callers 4

restartFunction · 0.85
setEnabledFunction · 0.85
setPortFunction · 0.85

Calls 3

closeMethod · 0.65
errorMethod · 0.65
infoMethod · 0.65

Tested by

no test coverage detected