]> git.codecow.com Git - nano-pow.git/commitdiff
Move server exit out of execution and into process management.
authorChris Duncan <chris@zoso.dev>
Mon, 16 Jun 2025 19:49:20 +0000 (12:49 -0700)
committerChris Duncan <chris@zoso.dev>
Mon, 16 Jun 2025 19:49:20 +0000 (12:49 -0700)
src/bin/cli.ts

index 65fcc0ebf5bbe4b1279a93a3dc4e9138a6a8d062..09c0985d31a7e1461b7831f5c73cfb2e8c2e4d8b 100755 (executable)
@@ -172,6 +172,8 @@ server.on('message', async (msg: Serializable): Promise<void> => {
                                        await execute()
                                } catch {
                                        logger.log(`Error executing ${body.action}`)
+                               } finally {
+                                       server.kill()
                                }
                        } else {
                                logger.log('CLI server failed to connect over IPC')
@@ -229,5 +231,4 @@ async function execute (): Promise<void> {
        }
        if (isBatch && !isBenchmark) console.log(results)
        if (process.env.NANO_POW_DEBUG || isBenchmark) console.log(stats(times))
-       server.kill()
 }