mirror of https://gitee.com/bigwinds/arangodb
improve shutdown and feature reusability in tests (#2935)
This commit is contained in:
parent
0b6d6d9287
commit
07875791e5
|
@ -37,6 +37,14 @@ FeatureCacheFeature::FeatureCacheFeature(application_features::ApplicationServer
|
|||
_databaseFeature(nullptr) {
|
||||
setOptional(false);
|
||||
requiresElevatedPrivileges(false);
|
||||
|
||||
// reset it so it can be used in multiple tests
|
||||
Instance = nullptr;
|
||||
}
|
||||
|
||||
FeatureCacheFeature::~FeatureCacheFeature() {
|
||||
// reset it so it can be used in multiple tests
|
||||
Instance = nullptr;
|
||||
}
|
||||
|
||||
void FeatureCacheFeature::prepare() {
|
||||
|
|
|
@ -32,6 +32,7 @@ class DatabaseFeature;
|
|||
class FeatureCacheFeature final : public application_features::ApplicationFeature {
|
||||
public:
|
||||
explicit FeatureCacheFeature(application_features::ApplicationServer*);
|
||||
~FeatureCacheFeature();
|
||||
|
||||
public:
|
||||
void prepare() override final;
|
||||
|
|
|
@ -611,6 +611,7 @@ void ApplicationServer::start() {
|
|||
if (feature->state() == FeatureState::STARTED) {
|
||||
LOG_TOPIC(TRACE, Logger::STARTUP) << "forcefully stopping feature '" << feature->name() << "'";
|
||||
try {
|
||||
feature->beginShutdown();
|
||||
feature->stop();
|
||||
feature->state(FeatureState::STOPPED);
|
||||
} catch (...) {
|
||||
|
|
Loading…
Reference in New Issue