few fixes

This commit is contained in:
gitlabhq 2011-10-18 11:21:44 +03:00
parent 2daa6161fd
commit 5a5845e490
3 changed files with 10 additions and 9 deletions

View file

@ -27,13 +27,14 @@ class Gitosis
def configure
status = Timeout::timeout(20) do
File.open(File.join(Dir.tmpdir,"gitlabhq-gitosis.lock"), "w+") do |f|
f.flock(File::LOCK_EX)
pull
yield(self)
push
f.flock(File::LOCK_UN)
begin
f.flock(File::LOCK_EX)
pull
yield(self)
push
ensure
f.flock(File::LOCK_UN)
end
end
end
rescue Exception => ex