You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/06/29 06:12:23 UTC

[GitHub] [incubator-devlake] likyh commented on a diff in pull request #2374: [tapd]fix some bug when first collect

likyh commented on code in PR #2374:
URL: https://github.com/apache/incubator-devlake/pull/2374#discussion_r909233528


##########
plugins/tapd/tasks/shared.go:
##########
@@ -115,19 +115,24 @@ type TapdApiParams struct {
 	WorkspaceId  uint64
 }
 
-func CreateRawDataSubTaskArgs(taskCtx core.SubTaskContext, rawTable string) (*helper.RawDataSubTaskArgs, *TapdTaskData) {
+func CreateRawDataSubTaskArgs(taskCtx core.SubTaskContext, rawTable string, useCompanyId bool) (*helper.RawDataSubTaskArgs, *TapdTaskData) {
 	data := taskCtx.GetData().(*TapdTaskData)
+	filteredData := *data
+	filteredData.Options = &TapdOptions{}
+	*filteredData.Options = *data.Options
 	var params = TapdApiParams{
 		ConnectionId: data.Options.ConnectionId,
 		WorkspaceId:  data.Options.WorkspaceId,
 	}
-	if data.Options.CompanyId != 0 {
+	if data.Options.CompanyId != 0 && useCompanyId {
 		params.CompanyId = data.Options.CompanyId
+	} else {
+		filteredData.Options.CompanyId = 0
 	}
 	RawDataSubTaskArgs := &helper.RawDataSubTaskArgs{
 		Ctx:    taskCtx,
 		Params: params,
 		Table:  rawTable,
 	}
-	return RawDataSubTaskArgs, data
+	return RawDataSubTaskArgs, &filteredData

Review Comment:
   avoid using companyId but forget to set useCompanyId=true.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org