isConnectionValid method

  1. @override
bool isConnectionValid(
  1. DBMySqlConnectionWrapper connection, {
  2. bool checkUsage = true,
})
override

Returns true if connection is valid for usage.

Implementation

@override
bool isConnectionValid(DBMySqlConnectionWrapper connection,
    {bool checkUsage = true}) {
  if (connection.isClosed) return false;

  if (checkUsage && connection.isInactive(connectionInactivityLimit)) {
    return false;
  }

  return true;
}