mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-06 16:24:17 +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
|
// Check if already running
|
||||||
if (existsSync(pidFile)) {
|
if (existsSync(pidFile)) {
|
||||||
const pid = parseInt(readFileSync(pidFile, 'utf8').trim(), 10)
|
const pid = parseInt(readFileSync(pidFile, 'utf8').trim(), 10)
|
||||||
if (!isNaN(pid)) {
|
if (!isNaN(pid) && pid !== process.pid) {
|
||||||
try {
|
try {
|
||||||
process.kill(pid, 0)
|
process.kill(pid, 0)
|
||||||
console.error(
|
console.error(
|
||||||
@@ -218,7 +218,7 @@ export async function handleDaemonCommands(
|
|||||||
// Normal Startup logic: check if already running
|
// Normal Startup logic: check if already running
|
||||||
if (existsSync(pidFile)) {
|
if (existsSync(pidFile)) {
|
||||||
const pid = parseInt(readFileSync(pidFile, 'utf8').trim(), 10)
|
const pid = parseInt(readFileSync(pidFile, 'utf8').trim(), 10)
|
||||||
if (!isNaN(pid)) {
|
if (!isNaN(pid) && pid !== process.pid) {
|
||||||
try {
|
try {
|
||||||
process.kill(pid, 0)
|
process.kill(pid, 0)
|
||||||
console.error(
|
console.error(
|
||||||
|
|||||||
Reference in New Issue
Block a user