Module: Roda::RodaPlugins::PgDisconnect::InstanceMethods

Defined in:
lib/roda/plugins/pg_disconnect.rb

Instance Method Summary collapse

Instance Method Details

#_roda_handle_main_routeObject

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.



36
37
38
39
40
41
# 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

#callObject

:nocov: Handle old Roda dispatch API



25
26
27
28
29
30
# File 'lib/roda/plugins/pg_disconnect.rb', line 25

def call
  super
rescue Sequel::DatabaseDisconnectError, Sequel::DatabaseConnectionError, PG::ConnectionBad
  Process.kill(:QUIT, $$)
  raise
end