We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a668c26 commit e39dac2Copy full SHA for e39dac2
1 file changed
tasks/updater/network.rb
@@ -3,6 +3,8 @@ class Updater
3
module Network
4
protected
5
6
+ WRITE_FILES_MUTEX = Mutex.new
7
+
8
def get_paths_by_type(dir, file_re, recursive = true)
9
get_file_paths(dir, recursive).select { |path| path =~ file_re }
10
end
@@ -24,7 +26,7 @@ def read_files(path, files)
24
26
files.map do |name|
25
27
Thread.start {
28
contents[name] = open("#{path_url}/#{name}").read
- Thread.exclusive { write_cached_files path, name => contents[name] }
29
+ WRITE_FILES_MUTEX.synchronize { write_cached_files path, name => contents[name] }
30
}
31
end.each(&:join)
32
contents
0 commit comments