summaryrefslogtreecommitdiff
path: root/lib/gitlab/checks/lfs_integrity.rb
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-10-22 15:49:20 +0100
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-10-25 10:10:45 +0100
commit084a8b6101c25e5d3d4f97f078abd9a649a2fb64 (patch)
tree888cd28681c079561effde22bf6094e7c8db71b4 /lib/gitlab/checks/lfs_integrity.rb
parentf5d71ad8f3d1899a29bc12c4fcc8847b14195e3a (diff)
downloadgitlab-ce-084a8b6101c25e5d3d4f97f078abd9a649a2fb64.tar.gz
Adds tracing messages for slow git pushes
Whenever a git push takes more than 50 seconds the user will receive a trace from each check performed along with their timings
Diffstat (limited to 'lib/gitlab/checks/lfs_integrity.rb')
-rw-r--r--lib/gitlab/checks/lfs_integrity.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab/checks/lfs_integrity.rb b/lib/gitlab/checks/lfs_integrity.rb
index fa3dc1808df..1652d5a30a4 100644
--- a/lib/gitlab/checks/lfs_integrity.rb
+++ b/lib/gitlab/checks/lfs_integrity.rb
@@ -3,9 +3,10 @@
module Gitlab
module Checks
class LfsIntegrity
- def initialize(project, newrev)
+ def initialize(project, newrev, time_left)
@project = project
@newrev = newrev
+ @time_left = time_left
end
# rubocop: disable CodeReuse/ActiveRecord
@@ -13,7 +14,7 @@ module Gitlab
return false unless @newrev && @project.lfs_enabled?
new_lfs_pointers = Gitlab::Git::LfsChanges.new(@project.repository, @newrev)
- .new_pointers(object_limit: ::Gitlab::Git::Repository::REV_LIST_COMMIT_LIMIT)
+ .new_pointers(object_limit: ::Gitlab::Git::Repository::REV_LIST_COMMIT_LIMIT, dynamic_timeout: @time_left)
return false unless new_lfs_pointers.present?