Added auto reconnect option to database

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@3499 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2011-08-23 13:31:04 +00:00
parent a3ba83aca4
commit 3aa6c13c64
1 changed files with 4 additions and 1 deletions

View File

@ -31,9 +31,12 @@ void zmDbConnect()
{
if ( !mysql_init( &dbconn ) )
{
Error( "Can't initialise structure: %s", mysql_error( &dbconn ) );
Error( "Can't initialise database connection: %s", mysql_error( &dbconn ) );
exit( mysql_errno( &dbconn ) );
}
my_bool reconnect = 1;
if ( mysql_options( &dbconn, MYSQL_OPT_RECONNECT, &reconnect ) )
Fatal( "Can't set database auto reconnect option: %s", mysql_error( &dbconn ) );
std::string::size_type colonIndex = staticConfig.DB_HOST.find( ":/" );
if ( colonIndex != std::string::npos )
{