mirror of
https://github.com/Expand-sys/CCash
synced 2025-12-17 00:22:14 +11:00
🚚🐛 moved static declarations & fixed RESPONSE_PARSE
This commit is contained in:
parent
1120b7b4d0
commit
0f28a0cc19
1 changed files with 3 additions and 27 deletions
|
|
@ -1,29 +1,5 @@
|
|||
#include "bank_api.h"
|
||||
|
||||
#if MULTI_THREADED
|
||||
phmap::parallel_flat_hash_map<
|
||||
std::string, User,
|
||||
xxHashStringGen,
|
||||
phmap::priv::hash_default_eq<std::string>,
|
||||
phmap::priv::Allocator<phmap::priv::Pair<const std::string, User>>,
|
||||
4UL,
|
||||
std::mutex>
|
||||
Bank::users;
|
||||
#else
|
||||
phmap::parallel_flat_hash_map<std::string, User, xxHashStringGen> Bank::users;
|
||||
#endif
|
||||
|
||||
#if CONSERVATIVE_DISK_SAVE
|
||||
#if MULTI_THREADED
|
||||
ChangeFlag<false> Bank::save_flag;
|
||||
#else
|
||||
bool Bank::save_flag = false;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
std::shared_mutex Bank::iter_lock;
|
||||
std::string Bank::admin_account;
|
||||
|
||||
#define CACHE_FOREVER resp->setExpiredTime(0)
|
||||
|
||||
#define CORS resp->addHeader("Access-Control-Allow-Origin", "*")
|
||||
|
|
@ -33,9 +9,9 @@ static thread_local ondemand::parser parser;
|
|||
static thread_local simdjson::padded_string input(req->getBody()); \
|
||||
auto doc = parser.iterate(input);
|
||||
|
||||
#define RESPONSE_PARSE(R) \
|
||||
static thread_local auto resp = HttpResponse::newCustomHttpResponse(R); \
|
||||
CORS; \
|
||||
#define RESPONSE_PARSE(R) \
|
||||
auto resp = HttpResponse::newCustomHttpResponse(R); \
|
||||
CORS; \
|
||||
callback(resp)
|
||||
|
||||
#define RESPOND_TRUE \
|
||||
|
|
|
|||
Loading…
Reference in a new issue