Branch: Tag:

2012-04-12

2012-04-12 22:45:57 by Stephen R. van den Berg <srb@cuci.nl>

pgsql: Add support for optional infinite reconnects.

181:   //! @mapping   //! @member int "reconnect"   //! Set it to zero to disable automatic reconnects upon losing - //! the connection to the database + //! the connection to the database. Not setting it, or setting + //! it to one, will cause one timed reconnect to take place. + //! Setting it to -1 will cause the system to try and reconnect + //! indefinitely   //! @member int "use_ssl"   //! If the database supports and allows SSL connections, the session   //! will be SSL encrypted, if not, the connection will fallback
604:    if(!reconnect(1))    { sleep(RECONNECTDELAY);    if(!reconnect(1)) -  { sleep(RECONNECTBACKOFF); -  reconnect(1); +  { do sleep(RECONNECTBACKOFF); +  while(!reconnect(1) && options->reconnect==-1);    }    }    }