mirror of https://gitee.com/bigwinds/arangodb
fix broken vacillant interface
This commit is contained in:
parent
272324c506
commit
a6c48619b7
|
@ -48,6 +48,7 @@ Agent::Agent(config_t const& config)
|
|||
_lastCommitIndex(0),
|
||||
_spearhead(this),
|
||||
_readDB(this),
|
||||
_vacillant(this),
|
||||
_nextCompationAfter(_config.compactionStepSize()),
|
||||
_inception(std::make_unique<Inception>(this)),
|
||||
_activator(nullptr),
|
||||
|
@ -648,7 +649,7 @@ trans_ret_t Agent::transact(query_t const& queries) {
|
|||
|
||||
|
||||
// Non-persistent write to non-persisted key-value store
|
||||
write_ret_t Agent::write(query_t const& query) {
|
||||
write_ret_t Agent::vacillant(query_t const& query) {
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -86,13 +86,15 @@ void RestAgencyHandler::redirectRequest(std::string const& leaderId) {
|
|||
}
|
||||
}
|
||||
|
||||
RestStatus RestAgencyHandler::handleVaccilant() {
|
||||
RestStatus RestAgencyHandler::handleVacillant() {
|
||||
|
||||
// Must be a POST request
|
||||
if (_request->requestType() != rest::RequestType::POST) {
|
||||
generateError(rest::ResponseCode::METHOD_NOT_ALLOWED, 405);
|
||||
}
|
||||
|
||||
query_t query;
|
||||
|
||||
// Need Array input
|
||||
if (!query->slice().isArray()) {
|
||||
Builder body;
|
||||
|
@ -134,12 +136,15 @@ RestStatus RestAgencyHandler::handleVaccilant() {
|
|||
try {
|
||||
ret = _agent->vacillant(query);
|
||||
} catch (std::exception const& e) {
|
||||
Builder body;
|
||||
body.openObject();
|
||||
body.add("message", VPackValue(e.what()));
|
||||
body.close();
|
||||
generateResult(rest::ResponseCode::BAD, body.slice());
|
||||
return RestStatus::DONE;
|
||||
}
|
||||
|
||||
return RestStatus::DONE;
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue