Commit ae565d24 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Increased automerge timeout. Works for 300 commits MR on repo with 200MB size

parent 7058258a
...@@ -28,6 +28,7 @@ class GitlabMerge ...@@ -28,6 +28,7 @@ class GitlabMerge
end end
def pull def pull
Grit::Git.with_timeout(30.seconds) do
File.open(File.join(Rails.root, "tmp", "merge_repo", "#{project.path}.lock"), "w+") do |f| File.open(File.join(Rails.root, "tmp", "merge_repo", "#{project.path}.lock"), "w+") do |f|
f.flock(File::LOCK_EX) f.flock(File::LOCK_EX)
...@@ -42,7 +43,10 @@ class GitlabMerge ...@@ -42,7 +43,10 @@ class GitlabMerge
output = merge_repo.git.pull({}, "--no-ff", "origin", merge_request.source_branch) output = merge_repo.git.pull({}, "--no-ff", "origin", merge_request.source_branch)
yield(merge_repo, output) yield(merge_repo, output)
end end
end end
end end
rescue Grit::Git::GitTimeout
return false
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment