mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-19 01:22:14 +11:00
🐎🚚 resp is faster when local
This commit is contained in:
parent
074d024d77
commit
13d66b537c
1 changed files with 10 additions and 11 deletions
|
|
@ -15,14 +15,13 @@ static thread_local ondemand::parser parser;
|
||||||
static thread_local simdjson::padded_string input(req->getBody()); \
|
static thread_local simdjson::padded_string input(req->getBody()); \
|
||||||
static thread_local ondemand::document doc = parser.iterate(input)
|
static thread_local ondemand::document doc = parser.iterate(input)
|
||||||
|
|
||||||
thread_local static drogon::HttpResponsePtr resp;
|
|
||||||
#define RESPONSE_PARSE(R) \
|
#define RESPONSE_PARSE(R) \
|
||||||
resp = HttpResponse::newCustomHttpResponse(R); \
|
auto resp = HttpResponse::newCustomHttpResponse(R); \
|
||||||
CORS; \
|
CORS; \
|
||||||
callback(resp)
|
callback(resp)
|
||||||
|
|
||||||
#define RESPOND_TRUE \
|
#define RESPOND_TRUE \
|
||||||
resp = HttpResponse::newCustomHttpResponse(BankResponse(k200OK, "true")); \
|
auto resp = HttpResponse::newCustomHttpResponse(BankResponse(k200OK, "true")); \
|
||||||
CORS; \
|
CORS; \
|
||||||
CACHE_FOREVER; \
|
CACHE_FOREVER; \
|
||||||
callback(resp)
|
callback(resp)
|
||||||
|
|
@ -48,7 +47,7 @@ void api::GetLogs(req_args)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
resp = HttpResponse::newCustomHttpResponse(BankResponse(k404NotFound, "\"Logs are Disabled\""));
|
auto resp = HttpResponse::newCustomHttpResponse(BankResponse(k404NotFound, "\"Logs are Disabled\""));
|
||||||
CORS;
|
CORS;
|
||||||
CACHE_FOREVER;
|
CACHE_FOREVER;
|
||||||
callback(resp);
|
callback(resp);
|
||||||
|
|
@ -146,7 +145,7 @@ void api::ImpactBal(req_args) const
|
||||||
//System Usage
|
//System Usage
|
||||||
void api::Help(req_args) const
|
void api::Help(req_args) const
|
||||||
{
|
{
|
||||||
resp = HttpResponse::newRedirectionResponse("https://github.com/EntireTwix/CCash/blob/Refractor/README.md");
|
auto resp = HttpResponse::newRedirectionResponse("https://github.com/EntireTwix/CCash/blob/Refractor/README.md");
|
||||||
CACHE_FOREVER;
|
CACHE_FOREVER;
|
||||||
callback(resp);
|
callback(resp);
|
||||||
}
|
}
|
||||||
|
|
@ -178,7 +177,7 @@ void api::ApiProperties(req_args) const
|
||||||
temp["return_on_del_acc"] = return_account;
|
temp["return_on_del_acc"] = return_account;
|
||||||
}
|
}
|
||||||
|
|
||||||
resp = HttpResponse::newHttpJsonResponse(std::move(temp));
|
auto resp = HttpResponse::newHttpJsonResponse(std::move(temp));
|
||||||
CORS;
|
CORS;
|
||||||
CACHE_FOREVER;
|
CACHE_FOREVER;
|
||||||
callback(resp);
|
callback(resp);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue