diff --git a/src/zm_db.h b/src/zm_db.h index c707ad2b7..1f8273fc1 100644 --- a/src/zm_db.h +++ b/src/zm_db.h @@ -43,6 +43,8 @@ class zmDbRow { extern MYSQL dbconn; extern RecursiveMutex db_mutex; +extern bool zmDbConnected; + bool zmDbConnect(); void zmDbClose(); diff --git a/src/zm_logger.cpp b/src/zm_logger.cpp index 011a0166e..654e3e21f 100644 --- a/src/zm_logger.cpp +++ b/src/zm_logger.cpp @@ -361,7 +361,7 @@ Logger::Level Logger::databaseLevel(Logger::Level databaseLevel) { databaseLevel = limit(databaseLevel); if ( mDatabaseLevel != databaseLevel ) { if ( (databaseLevel > NOLOG) && (mDatabaseLevel <= NOLOG) ) { // <= NOLOG would be NOOPT - if ( !zmDbConnect() ) { + if ( !zmDbConnected ) { databaseLevel = NOLOG; } } // end if ( databaseLevel > NOLOG && mDatabaseLevel <= NOLOG )