Skip to content
Snippets Groups Projects
Commit 7192f86e authored by Riyad Preukschas's avatar Riyad Preukschas
Browse files

Fix Satellite#lock

parent 700a784b
No related branches found
No related tags found
1 merge request!1818Refactor Satellite Code
Loading
Loading
@@ -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
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment