ensure data safety
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
#include "utils.h"
|
||||
|
||||
std::string TicketSystemEngine::QueryTicket(const std::string &command) {
|
||||
AcquireReadAccess;
|
||||
command_id_t command_id;
|
||||
sscanf(command.c_str(), "[%llu]", &command_id);
|
||||
LOG->debug("command id: {}", command_id);
|
||||
@ -124,6 +125,7 @@ std::string TicketSystemEngine::QueryTicket(const std::string &command) {
|
||||
}
|
||||
|
||||
std::string TicketSystemEngine::QueryTransfer(const std::string &command) {
|
||||
AcquireReadAccess;
|
||||
command_id_t command_id;
|
||||
sscanf(command.c_str(), "[%llu]", &command_id);
|
||||
LOG->debug("command id: {}", command_id);
|
||||
@ -386,6 +388,7 @@ void TicketSystemEngine::CheckTransfer(hash_t train1_ID_hash, hash_t train2_ID_h
|
||||
}
|
||||
|
||||
std::string TicketSystemEngine::BuyTicket(const std::string &command) {
|
||||
AcquireWriteAccess;
|
||||
command_id_t command_id;
|
||||
sscanf(command.c_str(), "[%llu]", &command_id);
|
||||
LOG->debug("command id: {}", command_id);
|
||||
@ -493,6 +496,7 @@ std::string TicketSystemEngine::BuyTicket(const std::string &command) {
|
||||
}
|
||||
|
||||
std::string TicketSystemEngine::QueryOrder(const std::string &command) {
|
||||
AcquireReadAccess;
|
||||
command_id_t command_id;
|
||||
sscanf(command.c_str(), "[%llu]", &command_id);
|
||||
LOG->debug("command id: {}", command_id);
|
||||
@ -546,6 +550,7 @@ std::string TicketSystemEngine::QueryOrder(const std::string &command) {
|
||||
}
|
||||
|
||||
std::string TicketSystemEngine::RefundTicket(const std::string &command) {
|
||||
AcquireWriteAccess;
|
||||
command_id_t command_id;
|
||||
sscanf(command.c_str(), "[%llu]", &command_id);
|
||||
LOG->debug("command id: {}", command_id);
|
||||
|
Reference in New Issue
Block a user