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

Function initApiServer

apps/desktop/main/ipc/api.ts:241–260  ·  view source on GitHub ↗
(ctx: IpcContext)

Source from the content-addressed store, hash-verified

239 * Auto-start API server and Pull scheduler after app launch
240 */
241export async function initApiServer(ctx: IpcContext): Promise<void> {
242 ensureInstances()
243
244 await apiServer.autoStart()
245
246 const status = apiServer.getStatus()
247 if (status.error) {
248 ctx.win.webContents.once('did-finish-load', () => {
249 ctx.win.webContents.send('api:startupError', {
250 error: status.error,
251 })
252 })
253 }
254
255 initScheduler({
256 dsManager,
257 pullEngine,
258 logger: syncLogger,
259 })
260}
261
262export async function cleanupApiServer(): Promise<void> {
263 stopAllTimers()

Callers 1

mainIpcMainFunction · 0.90

Calls 3

initSchedulerFunction · 0.90
ensureInstancesFunction · 0.85
getStatusMethod · 0.80

Tested by

no test coverage detected