mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-23 14:36:56 +00:00
fix(cli): bypass already running check if matching current process pid
This commit is contained in:
@@ -94,7 +94,7 @@ function startDaemon(appName: string, pidFile: string, logFile: string): void {
|
||||
// Check if already running
|
||||
if (existsSync(pidFile)) {
|
||||
const pid = parseInt(readFileSync(pidFile, 'utf8').trim(), 10)
|
||||
if (!isNaN(pid)) {
|
||||
if (!isNaN(pid) && pid !== process.pid) {
|
||||
try {
|
||||
process.kill(pid, 0)
|
||||
console.error(
|
||||
@@ -218,7 +218,7 @@ export async function handleDaemonCommands(
|
||||
// Normal Startup logic: check if already running
|
||||
if (existsSync(pidFile)) {
|
||||
const pid = parseInt(readFileSync(pidFile, 'utf8').trim(), 10)
|
||||
if (!isNaN(pid)) {
|
||||
if (!isNaN(pid) && pid !== process.pid) {
|
||||
try {
|
||||
process.kill(pid, 0)
|
||||
console.error(
|
||||
|
||||
Reference in New Issue
Block a user