diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2017-10-16 12:11:31 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-10-16 12:11:31 +0300 |
commit | f530261773b13df26457aa0d099f85e9791505c1 (patch) | |
tree | 18eb812ab9928ce71de5e9cd560c6deb58209a3e /lib/gitlab/git/repository.rb | |
parent | fde837d53120a24b2ba512327185f0705e56c9c6 (diff) |
Popen with a timeout
Diffstat (limited to 'lib/gitlab/git/repository.rb')
-rw-r--r-- | lib/gitlab/git/repository.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index f99be3cef7b..54f66b0683a 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -1072,6 +1072,13 @@ module Gitlab end # Refactoring aid; allows us to copy code from app/models/repository.rb + def run_git_with_timeout(args, timeout, env: {}) + circuit_breaker.perform do + popen_with_timeout([Gitlab.config.git.bin_path, *args], timeout, path, env) + end + end + + # Refactoring aid; allows us to copy code from app/models/repository.rb def commit(ref = 'HEAD') Gitlab::Git::Commit.find(self, ref) end |