Skip to content

Commit

Permalink
Merge branch 'multi-reload'
Browse files Browse the repository at this point in the history
  • Loading branch information
rsamoilov committed May 26, 2024
2 parents 3eb6ed1 + 8a45122 commit b738747
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/rage/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
Rails.configuration.after_initialize do
conditional_mutex = Module.new do
def call(env)
@mutex ||= Mutex.new
if Rails.application.reloader.check!
@mutex.synchronize { super }
res = if Rails.application.reloader.check! || !$rage_code_loaded
Fiber.new(blocking: true) { super }.resume
else
super
end
$rage_code_loaded = true

res
end
end

Expand Down

0 comments on commit b738747

Please sign in to comment.