Skip to content

Commit 42dbbe9

Browse files
committed
fix: logview to use public host
1 parent 250ea6a commit 42dbbe9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

mc2mc/internal/client/odps.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func (c *odpsClient) ExecSQL(ctx context.Context, query string, additionalHints
4646
}
4747

4848
// generate log view
49-
url, err := odps.NewLogView(c.client).GenerateLogView(taskIns, c.logViewRetentionInDays*24)
49+
url, err := c.generateLogView(taskIns)
5050
if err != nil {
5151
err = e.Join(err, taskIns.Terminate())
5252
return errors.WithStack(err)
@@ -109,6 +109,13 @@ func (c *odpsClient) GetOrderedColumns(tableID string) ([]string, error) {
109109
return columnNames, nil
110110
}
111111

112+
// generateLogView generates the log view for the given task instance
113+
func (c *odpsClient) generateLogView(taskIns *odps.Instance) (string, error) {
114+
// generate log view with public host endpoint
115+
client := odps.NewOdps(c.client.Account(), "http://service.id-all.maxcompute.aliyun-inc.com")
116+
return odps.NewLogView(client).GenerateLogView(taskIns, c.logViewRetentionInDays*24)
117+
}
118+
112119
// wait waits for the task instance to finish on a separate goroutine
113120
func (c *odpsClient) wait(taskIns *odps.Instance) <-chan error {
114121
errChan := make(chan error)

0 commit comments

Comments
 (0)