Commit 3c4689c23c9d6f50e9facb48a8dc0a7344764ebf

Authored by Dmitriy Zaporozhets
1 parent 9f087fb9

Store satellites lock files inside satellites dir

Showing 1 changed file with 12 additions and 1 deletions   Show diff stats
lib/gitlab/satellite/satellite.rb
@@ -64,7 +64,8 @@ module Gitlab @@ -64,7 +64,8 @@ module Gitlab
64 end 64 end
65 65
66 def lock_file 66 def lock_file
67 - Rails.root.join("tmp", "satellite_#{project.id}.lock") 67 + create_locks_dir unless File.exists?(lock_files_dir)
  68 + File.join(lock_files_dir, "satellite_#{project.id}.lock")
68 end 69 end
69 70
70 def path 71 def path
@@ -114,6 +115,16 @@ module Gitlab @@ -114,6 +115,16 @@ module Gitlab
114 def update_from_source! 115 def update_from_source!
115 repo.git.fetch({timeout: true}, :origin) 116 repo.git.fetch({timeout: true}, :origin)
116 end 117 end
  118 +
  119 + # Create directory for stroing
  120 + # satellites lock files
  121 + def create_locks_dir
  122 + FileUtils.mkdir_p(lock_files_dir)
  123 + end
  124 +
  125 + def lock_files_dir
  126 + @lock_files_dir ||= File.join(Gitlab.config.satellites.path, "tmp")
  127 + end
117 end 128 end
118 end 129 end
119 end 130 end