fix; log error
This commit is contained in:
@@ -45,6 +45,7 @@ func (s *BarProcessor) Execute(data any) (any, error) {
|
||||
|
||||
err := json.Unmarshal([]byte(sysJob.TargetParams), ¶ms)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user