fix; log error

This commit is contained in:
zhangsz
2025-03-28 10:22:20 +08:00
parent e971e0be9d
commit c12061ce36

View File

@@ -45,6 +45,7 @@ func (s *BarProcessor) Execute(data any) (any, error) {
err := json.Unmarshal([]byte(sysJob.TargetParams), &params)
if err != nil {
log.Error("failed to unmarshal:", err)
return nil, err
}
@@ -80,6 +81,7 @@ func (s *BarProcessor) Execute(data any) (any, error) {
// filePath := fmt.Sprintf("%s/%s_export_%s.csv", params.FilePath, params.TableName, time.Now().Format("20060102150405"))
affected, err := s.exportData(query, filePath)
if err != nil {
log.Errorf("failed to export data: %v", err)
return nil, err
}
@@ -98,7 +100,7 @@ func (s *BarProcessor) exportData(query, filePath string) (int64, error) {
}
defer rows.Close()
// 创建 CSV 文件
// 创建 文件
file, err := os.Create(filePath)
if err != nil {
return 0, err