Skip to content
Permalink
Browse files

Postgres connection: limit user/pw queries to 5 (avoids blocking serv…

…er instances if a db does not exist anymore)
  • Loading branch information
mhugent committed Oct 8, 2014
1 parent b3f00ec commit 149ad599db477d1ccbd304a0bbc5663d3a9b955b
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/providers/postgres/qgspostgresconn.cpp
@@ -183,8 +183,10 @@ QgsPostgresConn::QgsPostgresConn( QString conninfo, bool readOnly, bool shared )

QgsCredentials::instance()->lock();

while ( PQstatus() != CONNECTION_OK )
int i = 0;
while ( PQstatus() != CONNECTION_OK && i < 5 )
{
++i;
bool ok = QgsCredentials::instance()->get( conninfo, username, password, PQerrorMessage() );
if ( !ok )
break;

0 comments on commit 149ad59

Please sign in to comment.
You can’t perform that action at this time.