提交 7192f86e 编写于 作者: R Riyad Preukschas

Fix Satellite#lock

上级 700a784b
......@@ -25,14 +25,18 @@ module Gitlab
File.exists? path
end
# Locks the satellite and yields
# * Locks the satellite
# * Changes the current directory to the satellite's working dir
# * Yields
def lock
raise "Satellite doesn't exist" unless exists?
File.open(lock_file, "w+") do |f|
f.flock(File::LOCK_EX)
return yield
Dir.chdir(path) do
return yield
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册