Commit 903f9491ba097909f7d2e66873ff25d1505df07e

Authored by Valery Sizov
1 parent ff8136cd

MR: change path to lock file

Showing 1 changed file with 2 additions and 4 deletions   Show diff stats
lib/gitlab_merge.rb
... ... @@ -26,11 +26,9 @@ class GitlabMerge
26 26  
27 27 def process
28 28 Grit::Git.with_timeout(30.seconds) do
29   - # Make sure tmp/merge_repo exists
30   - lock_path = File.join(Rails.root, "tmp", "merge_repo")
31   - FileUtils.mkdir_p(lock_path) unless File.exists?(File.join(Rails.root, "tmp", "merge_repo"))
  29 + lock_file = File.join(Rails.root, "tmp", "merge_repo_#{project.path}.lock")
32 30  
33   - File.open(File.join(lock_path, "#{project.path}.lock"), "w+") do |f|
  31 + File.open(lock_file, "w+") do |f|
34 32 f.flock(File::LOCK_EX)
35 33  
36 34 unless project.satellite.exists?
... ...