summaryrefslogtreecommitdiff
path: root/app/workers
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-04-04 13:33:42 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-04-04 13:33:42 +0000
commit796d65f1feeb13c5bbdedee3f7290bd962c4c421 (patch)
treefee4fcfd24818c3bef0bde6faf1b6c1b51aeb887 /app/workers
parent7f8f927aafb0f3a618ccce76e802e30a16b04b42 (diff)
parente52b1df1d5391f0fa0b9ec7eb2d3492b05f64ba4 (diff)
downloadgitlab-ce-796d65f1feeb13c5bbdedee3f7290bd962c4c421.tar.gz
Merge branch '29492-useless-queries' into 'master'
remove useless queries with false conditions (e.g 1=0) Closes #29492 See merge request !10141
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/process_commit_worker.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/workers/process_commit_worker.rb b/app/workers/process_commit_worker.rb
index e9a5bd7f24e..2f7967cf531 100644
--- a/app/workers/process_commit_worker.rb
+++ b/app/workers/process_commit_worker.rb
@@ -53,6 +53,8 @@ class ProcessCommitWorker
def update_issue_metrics(commit, author)
mentioned_issues = commit.all_references(author).issues
+ return if mentioned_issues.empty?
+
Issue::Metrics.where(issue_id: mentioned_issues.map(&:id), first_mentioned_in_commit_at: nil).
update_all(first_mentioned_in_commit_at: commit.committed_date)
end