Commit 903f9491 authored by Valery Sizov's avatar Valery Sizov

MR: change path to lock file

parent ff8136cd
...@@ -26,11 +26,9 @@ class GitlabMerge ...@@ -26,11 +26,9 @@ class GitlabMerge
def process def process
Grit::Git.with_timeout(30.seconds) do Grit::Git.with_timeout(30.seconds) do
# Make sure tmp/merge_repo exists lock_file = File.join(Rails.root, "tmp", "merge_repo_#{project.path}.lock")
lock_path = File.join(Rails.root, "tmp", "merge_repo")
FileUtils.mkdir_p(lock_path) unless File.exists?(File.join(Rails.root, "tmp", "merge_repo"))
File.open(File.join(lock_path, "#{project.path}.lock"), "w+") do |f| File.open(lock_file, "w+") do |f|
f.flock(File::LOCK_EX) f.flock(File::LOCK_EX)
unless project.satellite.exists? unless project.satellite.exists?
......
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