diff --git a/internal/log/file_record.go b/internal/log/file_record.go index d56ed31..798afcb 100644 --- a/internal/log/file_record.go +++ b/internal/log/file_record.go @@ -35,6 +35,8 @@ func NewFileRecorder(filePath string) *FileRecorder { // Append 增加数据记录 func (f *FileRecorder) Append(item *FileRecordItem) error { + f.locker.Lock() + defer f.locker.Unlock() savePath := f.Path folder := filepath.Dir(savePath) if b, err := utils.PathExists(folder); err == nil && !b {