重构: App拆分10域文件+并发安全+结构化日志+依赖升级

This commit is contained in:
lxy
2026-05-16 20:45:14 +08:00
parent d17c20c579
commit 767311fc04
27 changed files with 1457 additions and 1218 deletions
+2 -2
View File
@@ -20,8 +20,8 @@ func NewFileLockChecker() *FileLockChecker {
// IsFileLocked 检查文件是否被锁定(被其他进程占用)
// 返回: (是否锁定, 错误信息, 错误)
func (c *FileLockChecker) IsFileLocked(path string) (bool, string, error) {
// 尝试以独占写模式打开文件
file, err := os.OpenFile(path, os.O_RDWR|syscall.O_CREAT, 0666)
// 尝试以独占写模式打开文件(不创建新文件)
file, err := os.OpenFile(path, os.O_RDWR, 0)
if err != nil {
// 检查是否是锁相关的错误
if isLockError(err) {