Skip to content

Commit 250ea6a

Browse files
authored
refactor: enhance log with task id (#85)
* refactor: enhance log with task id * fix: remove comma to avoid broken url
1 parent d22aa3a commit 250ea6a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mc2mc/internal/client/odps.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (c *odpsClient) ExecSQL(ctx context.Context, query string, additionalHints
5151
err = e.Join(err, taskIns.Terminate())
5252
return errors.WithStack(err)
5353
}
54-
c.logger.Info(fmt.Sprintf("taskId: %s, log view: %s, hints: (%s)", taskIns.Id(), url, getHintsString(hints)))
54+
c.logger.Info(fmt.Sprintf("taskId: %s, log view: %s , hints: (%s)", taskIns.Id(), url, getHintsString(hints)))
5555

5656
// wait execution success
5757
select {
@@ -118,6 +118,7 @@ func (c *odpsClient) wait(taskIns *odps.Instance) <-chan error {
118118
defer close(errChan)
119119
err := c.retry(taskIns.WaitForSuccess)
120120
if err != nil {
121+
err := errors.Wrap(err, fmt.Sprintf("task instance %s failed", taskIns.Id()))
121122
errChan <- errors.WithStack(err)
122123
}
123124
c.logger.Info(fmt.Sprintf("task instance %s finished with status: %s", taskIns.Id(), taskIns.Status()))

0 commit comments

Comments
 (0)