module Roda::RodaPlugins::PgDisconnect::InstanceMethods

Public Instance Methods

_roda_handle_main_route() click to toggle source

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 unveiled or pledged.

Calls superclass method
# File lib/roda/plugins/pg_disconnect.rb, line 36
def _roda_handle_main_route
  super
rescue Sequel::DatabaseDisconnectError, Sequel::DatabaseConnectionError, PG::ConnectionBad
  Process.kill(:QUIT, $$)
  raise
end
call() click to toggle source

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 unveiled or pledged.

Calls superclass method
# File lib/roda/plugins/pg_disconnect.rb, line 26
def call
  super
rescue Sequel::DatabaseDisconnectError, Sequel::DatabaseConnectionError, PG::ConnectionBad
  Process.kill(:QUIT, $$)
  raise
end