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:10:18 UTC
[GitHub] [incubator-devlake] abeizn commented on a diff in pull request #2374: [tapd]fix some bug when first collect
abeizn commented on code in PR #2374:
URL: https://github.com/apache/incubator-devlake/pull/2374#discussion_r909232255
##########
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:
why not return 'data'?
--
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