Skip to content

Commit

Permalink
Make health check autodetectable.
Browse files Browse the repository at this point in the history
Also have generator comment out Rails 7.1 health check.

See also:
* superfly/flyctl#1678
* rails/rails#47217
* rails/rails#46936
  • Loading branch information
rubys committed Feb 7, 2023
1 parent 8afb0f0 commit 396ed4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/generators/healthcheck/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def create_initializer_file
HEALTHCHECK_INITIALIZER_TEXT
)
route 'Healthcheck.routes(self)'
comment_lines 'config/routes.rb', /:rails_health_check/
end
end
end
3 changes: 2 additions & 1 deletion lib/healthcheck/router.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ class Router
def self.mount(router)
router.send(
Healthcheck.configuration.method,
Healthcheck.configuration.route => 'healthcheck/healthchecks#check'
Healthcheck.configuration.route => 'healthcheck/healthchecks#check',
as: :rails_health_check
)
end
end
Expand Down

0 comments on commit 396ed4b

Please sign in to comment.