bigpresh / Dancer-Plugin-Database

Dancer::Plugin::Database - easy database support for Dancer applications
http://search.cpan.org/dist/Dancer-Plugin-Database
37 stars 36 forks source link

Join the reconnection and connection codepaths #49

Closed jmazon closed 10 years ago

jmazon commented 10 years ago

Previous patch solved the problem with a half measure: it simply copied the missing part of the reconnection flow from the connection flow (namely, saving the DBI handle). It's better to just use the same code.

Short term benefit: the last_connection_check timestamp will be set at connection time, instead of at the next call after reconnect, which allows to spare a connection check on the next call. Long term benefit: fewer chances of diverging further.