refactor: use nginx -s reload instead of systemd

- doc: add comment
This commit is contained in:
2026-08-17 10:10:14 +08:00
parent 79f18fcdea
commit f536987a7e
62 changed files with 2216 additions and 598 deletions
+4 -1
View File
@@ -15,7 +15,9 @@ import (
// Lock 持有与文件描述符绑定的 Linux advisory flock。
// 锁文件可以永久存在;只有内核锁状态表示当前所有权。
type Lock struct {
mu sync.Mutex
// mu 保证释放操作与状态访问的并发安全。
mu sync.Mutex
// file 与内核锁绑定的锁文件描述符。
file *os.File
}
@@ -50,6 +52,7 @@ func Acquire(path string) (*Lock, error) {
return &Lock{file: file}, nil
}
// writeOwnerPID 将当前进程 PID 写入锁文件并落盘,供诊断排查。
func writeOwnerPID(file *os.File) error {
if err := file.Truncate(0); err != nil {
return fmt.Errorf("truncate process lock metadata: %w", err)