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 463a502 commit 7c2ab3fCopy full SHA for 7c2ab3f
lib/propshaft/load_path.rb
@@ -44,9 +44,13 @@ def cache_sweeper
44
@cache_sweeper ||= begin
45
exts_to_watch = Mime::EXTENSION_LOOKUP.map(&:first)
46
files_to_watch = Array(paths).collect { |dir| [ dir.to_s, exts_to_watch ] }.to_h
47
+ mutex = Mutex.new
48
49
Rails.application.config.file_watcher.new([], files_to_watch) do
- clear_cache
50
+ mutex.synchronize do
51
+ clear_cache
52
+ seed_cache
53
+ end
54
end
55
56
@@ -81,6 +85,10 @@ def clear_cache
81
85
@cached_asset_paths_by_glob = nil
82
86
83
87
88
+ def seed_cache
89
+ assets_by_path
90
91
+
84
92
def dedup(paths)
93
paths = Array(paths).map { |path| Pathname.new(path) }
94
deduped = [].tap do |deduped|
0 commit comments