Skip to content

Commit f419c0e

Browse files
committed
fix: 更新版本号至v0.2.1并改进守护进程停止逻辑
1 parent fc993c2 commit f419c0e

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

cmd/daemon.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,11 @@ func StopDaemon() error {
226226
time.Sleep(1 * time.Second)
227227
}
228228

229+
// 如果进程还在运行,强制杀死
229230
if IsRunning() {
230-
if err := process.Signal(syscall.SIGKILL); err != nil {
231-
return fmt.Errorf("强制停止失败: %w", err)
232-
}
231+
// 忽略错误,因为进程可能在检查和发送信号之间已经退出
232+
process.Signal(syscall.SIGKILL)
233+
time.Sleep(500 * time.Millisecond)
233234
}
234235

235236
os.Remove(pidFile)

internal/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
var (
1212
Config *Configuration
13-
Version = "v0.2.0"
13+
Version = "v0.2.1"
1414
URL = URLProd
1515
URLProd = "https://anssl.cn/deploy"
1616
URLLocal = "http://localhost:9000/deploy"

0 commit comments

Comments
 (0)