Beispiel #1
0
bool DBHandle::checkDB() {
  try {
    auto handle = DBHandle(FLAGS_database_path, FLAGS_database_in_memory);
  } catch (const std::exception& e) {
    return false;
  }
  return true;
}
Beispiel #2
0
bool DBHandle::checkDB() {
  // Allow database instances to check if a status/sanity check was requested.
  kCheckingDB = true;
  try {
    auto handle = DBHandle(FLAGS_database_path, FLAGS_database_in_memory);
    kCheckingDB = false;
    if (kDBHandleOptionRequireWrite && handle.read_only_) {
      return false;
    }
  } catch (const std::exception& e) {
    kCheckingDB = false;
    VLOG(1) << e.what();
    return false;
  }
  return true;
}