# HG changeset patch # User Tomasz Sterna # Date 1302701846 -7200 # Node ID c2554fee5c21eb6db3d392331c4309f0f609c1a1 # Parent 1d95b69c2c81d9b200476fb4e2c0625fafd79ddc Reconnect on DB disconnection. diff -r 1d95b69c2c81 -r c2554fee5c21 mod_auth_sql/mod_auth_sql.lua --- a/mod_auth_sql/mod_auth_sql.lua Tue Apr 12 22:57:34 2011 +0000 +++ b/mod_auth_sql/mod_auth_sql.lua Wed Apr 13 15:37:26 2011 +0200 @@ -60,6 +60,7 @@ if params.driver == "PostgreSQL" then sql = sql:gsub("`", "\""); end + if not test_connection() then connect() end -- do prepared statement stuff local stmt, err = connection:prepare(sql); if not stmt and not test_connection() then error("connection failed"); end