mirror of https://gitee.com/bigwinds/arangodb
Suppress startup warning about no user table. (#6904)
* Suppress startup warning about no user table. * fix compilation
This commit is contained in:
parent
3062d9685c
commit
45e4a8dda1
|
@ -37,6 +37,7 @@
|
||||||
#include "GeneralServer/GeneralServerFeature.h"
|
#include "GeneralServer/GeneralServerFeature.h"
|
||||||
#include "Logger/Logger.h"
|
#include "Logger/Logger.h"
|
||||||
#include "Random/UniformCharacter.h"
|
#include "Random/UniformCharacter.h"
|
||||||
|
#include "RestServer/BootstrapFeature.h"
|
||||||
#include "RestServer/DatabaseFeature.h"
|
#include "RestServer/DatabaseFeature.h"
|
||||||
#include "RestServer/InitDatabaseFeature.h"
|
#include "RestServer/InitDatabaseFeature.h"
|
||||||
#include "RestServer/SystemDatabaseFeature.h"
|
#include "RestServer/SystemDatabaseFeature.h"
|
||||||
|
@ -233,6 +234,15 @@ void auth::UserManager::loadFromDB() {
|
||||||
_internalVersion.store(tmp);
|
_internalVersion.store(tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (basics::Exception const& ex) {
|
||||||
|
auto bootstrap = application_features::ApplicationServer::lookupFeature<BootstrapFeature>();
|
||||||
|
if (ex.code() != TRI_ERROR_ARANGO_DATA_SOURCE_NOT_FOUND ||
|
||||||
|
(bootstrap != nullptr && bootstrap->isReady())) {
|
||||||
|
LOG_TOPIC(WARN, Logger::AUTHENTICATION)
|
||||||
|
<< "Exception when loading users from db: " << ex.what();
|
||||||
|
}
|
||||||
|
// suppress log messgage if we get here during the normal course of an
|
||||||
|
// agency callback during bootstrapping and carry on
|
||||||
} catch (std::exception const& ex) {
|
} catch (std::exception const& ex) {
|
||||||
LOG_TOPIC(WARN, Logger::AUTHENTICATION)
|
LOG_TOPIC(WARN, Logger::AUTHENTICATION)
|
||||||
<< "Exception when loading users from db: " << ex.what();
|
<< "Exception when loading users from db: " << ex.what();
|
||||||
|
|
|
@ -38,6 +38,9 @@
|
||||||
#include "VocBase/Methods/Upgrade.h"
|
#include "VocBase/Methods/Upgrade.h"
|
||||||
#include "V8Server/V8DealerFeature.h"
|
#include "V8Server/V8DealerFeature.h"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
static std::string const FEATURE_NAME("Bootstrap");
|
||||||
|
}
|
||||||
|
|
||||||
using namespace arangodb;
|
using namespace arangodb;
|
||||||
using namespace arangodb::options;
|
using namespace arangodb::options;
|
||||||
|
@ -47,8 +50,9 @@ static std::string const boostrapKey = "Bootstrap";
|
||||||
BootstrapFeature::BootstrapFeature(
|
BootstrapFeature::BootstrapFeature(
|
||||||
application_features::ApplicationServer& server
|
application_features::ApplicationServer& server
|
||||||
)
|
)
|
||||||
: ApplicationFeature(server, "Bootstrap"), _isReady(false), _bark(false) {
|
: ApplicationFeature(server, ::FEATURE_NAME), _isReady(false), _bark(false) {
|
||||||
startsAfter("ServerPhase");
|
startsAfter("ServerPhase");
|
||||||
|
startsAfter(SystemDatabaseFeature::name());
|
||||||
|
|
||||||
// TODO: It is only in FoxxPhase because of:
|
// TODO: It is only in FoxxPhase because of:
|
||||||
startsAfter("FoxxQueues");
|
startsAfter("FoxxQueues");
|
||||||
|
@ -63,6 +67,10 @@ BootstrapFeature::BootstrapFeature(
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*static*/ std::string const& BootstrapFeature::name() noexcept {
|
||||||
|
return FEATURE_NAME;
|
||||||
|
}
|
||||||
|
|
||||||
void BootstrapFeature::collectOptions(std::shared_ptr<ProgramOptions> options) {
|
void BootstrapFeature::collectOptions(std::shared_ptr<ProgramOptions> options) {
|
||||||
options->addHiddenOption("hund", "make ArangoDB bark on startup",
|
options->addHiddenOption("hund", "make ArangoDB bark on startup",
|
||||||
new BooleanParameter(&_bark));
|
new BooleanParameter(&_bark));
|
||||||
|
|
|
@ -35,6 +35,8 @@ class BootstrapFeature final : public application_features::ApplicationFeature {
|
||||||
void start() override final;
|
void start() override final;
|
||||||
void unprepare() override final;
|
void unprepare() override final;
|
||||||
|
|
||||||
|
static std::string const& name() noexcept;
|
||||||
|
|
||||||
bool isReady() const {
|
bool isReady() const {
|
||||||
return _isReady;
|
return _isReady;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue