(ctx: IpcContext)
| 239 | * Auto-start API server and Pull scheduler after app launch |
| 240 | */ |
| 241 | export 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 | |
| 262 | export async function cleanupApiServer(): Promise<void> { |
| 263 | stopAllTimers() |
no test coverage detected