diff options
Diffstat (limited to 'lib/gitlab/git_access.rb')
-rw-r--r-- | lib/gitlab/git_access.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb index 713a98bb556..1da466cbfd6 100644 --- a/lib/gitlab/git_access.rb +++ b/lib/gitlab/git_access.rb @@ -27,6 +27,12 @@ module Gitlab cannot_push_to_read_only: "You can't push code to a read-only GitLab instance." }.freeze + LOG_HEADER = <<~MESSAGE + Push operation timed out + + Timing information for debugging purposes: + MESSAGE + INTERNAL_TIMEOUT = 50.seconds.freeze DOWNLOAD_COMMANDS = %w{git-upload-pack git-upload-archive}.freeze PUSH_COMMANDS = %w{git-receive-pack}.freeze @@ -46,7 +52,7 @@ module Gitlab end def check(cmd, changes) - @logger = Checks::TimedLogger.new(timeout: INTERNAL_TIMEOUT) + @logger = Checks::TimedLogger.new(timeout: INTERNAL_TIMEOUT, header: LOG_HEADER) @changes = changes check_protocol! @@ -284,13 +290,7 @@ module Gitlab change_access.exec rescue Checks::TimedLogger::TimeoutError - header = <<~MESSAGE - Push operation timed out - - Timing information for debugging purposes: - MESSAGE - - raise TimeoutError, header + logger.log.join("\n") + raise TimeoutError, logger.full_message end def deploy_key |