(req: Request, res: Response)
| 285 | } |
| 286 | |
| 287 | export async function ApiSetRunConfig(req: Request, res: Response) { |
| 288 | try { |
| 289 | const configs = req.body; |
| 290 | const restart = req.query.restart === "true"; |
| 291 | console.log("restart", req.query.restart, restart); |
| 292 | let runMode = appConfigManager.getRunConfig(); |
| 293 | appConfigManager.set(CONFIG_KEYS.runConfig, JSON.stringify({ |
| 294 | ...runMode, |
| 295 | ...configs |
| 296 | })); |
| 297 | |
| 298 | if (restart) { |
| 299 | await comfyuiService.restartComfyUI(); |
| 300 | } |
| 301 | |
| 302 | res.send({ |
| 303 | success: true, |
| 304 | }); |
| 305 | } catch (err: any) { |
| 306 | logger.error(err.message + ":" + err.stack); |
| 307 | res.send({ |
| 308 | success: false, |
| 309 | error: err.message |
| 310 | }) |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | export async function ApiSetAppConfig(req: Request, res: Response) { |
| 315 | try { |
nothing calls this directly
no test coverage detected