Skip to content

Commit

Permalink
Remove dev's nonfunctional file update checker for api (#2599)
Browse files Browse the repository at this point in the history
  • Loading branch information
bensheldon authored Dec 12, 2024
1 parent 82f41a5 commit 12fc867
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,28 +98,5 @@

# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.

# Make sure we reload the API after every request!
@last_api_change = Time.current
api_reloader = ActiveSupport::FileUpdateChecker.new(Dir["#{Rails.root}/app/controllers/api/**/**/*.rb"]) { |reloader|
times = Dir["#{Rails.root}/app/api/**/*.rb"].map { |f| File.mtime(f) }
files = Dir["#{Rails.root}/app/api/**/*.rb"].map { |f| f }

Rails.logger.debug "! Change detected: reloading following files:"
files.each_with_index do |s, i|
if times[i] > @last_api_change
Rails.logger.debug " - #{s}"
load s
end
end

Rails.application.reload_routes!
Rails.application.routes_reloader.reload!
Rails.application.eager_load!
}

ActiveSupport::Reloader.to_prepare do
api_reloader.execute_if_updated
end
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
end

0 comments on commit 12fc867

Please sign in to comment.