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


##########
backend/plugins/jira/tasks/issue_changelog_collector.go:
##########
@@ -75,7 +75,17 @@ func CollectIssueChangelogs(taskCtx plugin.SubTaskContext) 
errors.Error {
        }
        incremental := collectorWithState.IsIncremental()
        if incremental {
-               clauses = append(clauses, dal.Having("i.updated > 
max(c.issue_updated) OR  (max(c.issue_updated) IS NULL AND 
COUNT(c.changelog_id) > 0)"))
+               clauses = append(clauses, dal.Having("i.updated > ? AND 
(i.updated > max(c.issue_updated) OR (max(c.issue_updated) IS NULL AND 
COUNT(c.changelog_id) > 0))", 
collectorWithState.LatestState.LatestSuccessStart))
+       } else {
+               /*
+                       i.updated > max(rl.issue_updated) was deleted because 
for non-incremental collection,
+                       max(rl.issue_updated) will only be one of null, less or 
equal to i.updated
+                       so i.updated > max(rl.issue_updated) is always false.

Review Comment:
   You mean `i.updated > max(rl.issue_updated) is always false` when 
`!incremental`. ok, that's right.



-- 
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]

Reply via email to