Commit 3c4689c23c9d6f50e9facb48a8dc0a7344764ebf
1 parent
9f087fb9
Exists in
master
and in
4 other branches
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 | 64 | end |
65 | 65 | |
66 | 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 | 69 | end |
69 | 70 | |
70 | 71 | def path |
... | ... | @@ -114,6 +115,16 @@ module Gitlab |
114 | 115 | def update_from_source! |
115 | 116 | repo.git.fetch({timeout: true}, :origin) |
116 | 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 | 128 | end |
118 | 129 | end |
119 | 130 | end | ... | ... |