diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-10-30 11:57:09 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2017-10-30 11:57:09 +0000 |
commit | c14697a50bd6eba6782f594f86757e2978d54596 (patch) | |
tree | 1082a40ad887296f746ed410bdaedc5402ef9a80 /app/models/merge_request.rb | |
parent | f83f15b2aea292db3474074566896a429e1e79b3 (diff) | |
parent | ba9b4c4de86aa816e5ddc7a9cde9193c43835223 (diff) | |
download | gitlab-ce-c14697a50bd6eba6782f594f86757e2978d54596.tar.gz |
Merge branch '39054-activerecord-statementinvalid-pg-querycanceled-error-canceling-statement-due-to-statement-timeout' into 'master'
Resolve "ActiveRecord::StatementInvalid: PG::QueryCanceled: ERROR: canceling statement due to statement timeout"
Closes #39054
See merge request gitlab-org/gitlab-ce!15063
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r-- | app/models/merge_request.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 07352db5d2d..d45b9c805a4 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -878,7 +878,7 @@ class MergeRequest < ActiveRecord::Base # def all_commit_shas if persisted? - column_shas = MergeRequestDiffCommit.where(merge_request_diff: merge_request_diffs).pluck('DISTINCT(sha)') + column_shas = MergeRequestDiffCommit.where(merge_request_diff: merge_request_diffs).limit(10_000).pluck('sha') serialised_shas = merge_request_diffs.where.not(st_commits: nil).flat_map(&:commit_shas) (column_shas + serialised_shas).uniq |