likyh commented on code in PR #3813:
URL:
https://github.com/apache/incubator-devlake/pull/3813#discussion_r1033176441
##########
plugins/jira/tasks/issue_changelog_collector.go:
##########
@@ -60,12 +60,10 @@ func CollectIssueChangelogs(taskCtx core.SubTaskContext)
errors.Error {
dal.Join("LEFT JOIN _tool_jira_issue_changelogs c ON
(c.connection_id = i.connection_id AND c.issue_id = i.issue_id)"),
dal.Where("i.updated > i.created AND bi.connection_id = ? AND
bi.board_id = ? AND i.std_type != ? ", data.Options.ConnectionId,
data.Options.BoardId, "Epic"),
dal.Groupby("i.issue_id, i.updated"),
- dal.Having("i.updated > max(c.issue_updated) OR
(max(c.issue_updated) IS NULL AND COUNT(c.changelog_id) > 0)"),
}
- // apply time range if any
- since := data.Since
- if since != nil {
- clauses = append(clauses, dal.Where("i.updated > ?", *since))
+ incremental := data.Meta.StartFrom != nil &&
data.Meta.StartFrom.Equal(*data.StartFrom)
Review Comment:
If the StartFrom passed by options (`data.StartFrom`) equals to the latest
collection's `StartFrom`, the collectors can work incrementally if they want.
If not, it means `StartFrom` changed and all data need to be deleted.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]