mirror of https://gitee.com/bigwinds/arangodb
The ShutdownHandler now uses VelocityPack instead of TRI_json_t
This commit is contained in:
parent
aff851ec81
commit
454b3f0d7a
|
@ -29,8 +29,6 @@
|
||||||
|
|
||||||
#include "RestShutdownHandler.h"
|
#include "RestShutdownHandler.h"
|
||||||
|
|
||||||
#include "Basics/json.h"
|
|
||||||
#include "Basics/tri-strings.h"
|
|
||||||
#include "Rest/HttpRequest.h"
|
#include "Rest/HttpRequest.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -83,10 +81,15 @@ bool RestShutdownHandler::isDirect () const {
|
||||||
HttpHandler::status_t RestShutdownHandler::execute () {
|
HttpHandler::status_t RestShutdownHandler::execute () {
|
||||||
_applicationServer->beginShutdown();
|
_applicationServer->beginShutdown();
|
||||||
|
|
||||||
TRI_json_t result;
|
try {
|
||||||
TRI_InitStringJson(&result, TRI_DuplicateStringZ(TRI_CORE_MEM_ZONE, "OK"), strlen("OK"));
|
VPackBuilder json;
|
||||||
generateResult(&result);
|
json.add(VPackValue("OK"));
|
||||||
TRI_DestroyJson(TRI_CORE_MEM_ZONE, &result);
|
VPackSlice slice(json.start());
|
||||||
|
generateResult(slice);
|
||||||
|
}
|
||||||
|
catch (...) {
|
||||||
|
// Ignore the error
|
||||||
|
}
|
||||||
|
|
||||||
return status_t(HANDLER_DONE);
|
return status_t(HANDLER_DONE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue