Module: Roda::RodaPlugins::PgDisconnect::InstanceMethods
- Defined in:
- lib/roda/plugins/pg_disconnect.rb
Instance Method Summary collapse
-
#_roda_handle_main_route ⇒ Object
When database connection is lost, kill the worker process, so a new one will be generated.
-
#call ⇒ Object
When database connection is lost, kill the worker process, so a new one will be generated.
Instance Method Details
#_roda_handle_main_route ⇒ Object
When database connection is lost, kill the worker process, so a new one will be generated. This is necessary because the unix socket used by the database connection is no longer available once the application is chrooted.
37 38 39 40 41 42 |
# File 'lib/roda/plugins/pg_disconnect.rb', line 37 def _roda_handle_main_route super rescue Sequel::DatabaseDisconnectError, Sequel::DatabaseConnectionError, PG::ConnectionBad Process.kill(:QUIT, $$) raise end |
#call ⇒ Object
When database connection is lost, kill the worker process, so a new one will be generated. This is necessary because the unix socket used by the database connection is no longer available once the application is chrooted.
27 28 29 30 31 32 |
# File 'lib/roda/plugins/pg_disconnect.rb', line 27 def call super rescue Sequel::DatabaseDisconnectError, Sequel::DatabaseConnectionError, PG::ConnectionBad Process.kill(:QUIT, $$) raise end |