add file recorder library

This commit is contained in:
xiaoyaofenfen 2022-12-19 19:17:31 +08:00
parent 1208ccad08
commit 6e8ee94285

View File

@ -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 {