UNPKG

@tehreet/conduit

Version:

LLM API gateway with intelligent routing, robust process management, and health monitoring

28 lines 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.closeService = closeService; const processCheck_1 = require("./processCheck"); const fs_1 = require("fs"); const constants_1 = require("../constants"); const path_1 = require("path"); async function closeService() { const PID_FILE = (0, path_1.join)(constants_1.HOME_DIR, '.conduit.pid'); if (!(0, processCheck_1.isServiceRunning)()) { console.log('No service is currently running.'); return; } if ((0, processCheck_1.getReferenceCount)() > 0) { return; } try { const pid = parseInt((0, fs_1.readFileSync)(PID_FILE, 'utf-8')); process.kill(pid); (0, processCheck_1.cleanupPidFile)(); console.log('claude code router service has been successfully stopped.'); } catch (e) { console.log('Failed to stop the service. It may have already been stopped.'); (0, processCheck_1.cleanupPidFile)(); } } //# sourceMappingURL=close.js.map