Merge branch 'grpc' of ssh://**REDACTED**/~/c++/gradido_login_server into grpc

This commit is contained in:
Dario 2020-12-07 17:25:05 +01:00 committed by Ulf Gebhardt
commit fdcbc024b6
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD
5 changed files with 29 additions and 2 deletions

View File

@ -175,7 +175,7 @@ PingServerTask::~PingServerTask()
int PingServerTask::run()
{
return 0;
//return 0;
auto current = Poco::DateTime();
if (model::table::NODE_SERVER_GRADIDO_COMMUNITY == mNodeServer->getModel()->getNodeServerType()) {
std::string url_port = mNodeServer->getModel()->getUrlWithPort();

View File

@ -54,6 +54,29 @@ namespace DataTypeConverter
return NUMBER_PARSE_LOGIC_ERROR;
}
}
NumberParseState strToInt(const std::string& input, Poco::UInt64& result)
{
try {
result = stoull(input);
return NUMBER_PARSE_OKAY;
}
catch (const std::invalid_argument& ia)
{
printf("[strToInt] exception: invalid argument: %s\n", ia.what());
return NUMBER_PARSE_INVALID_ARGUMENT;
}
catch (const std::out_of_range& oor)
{
printf("[strToInt] exception: out or range: %s\n", oor.what());
return NUMBER_PARSE_OUT_OF_RANGE;
}
catch (const std::logic_error & ler)
{
printf("[strToInt] exception: logical error: %s\n", ler.what());
return NUMBER_PARSE_LOGIC_ERROR;
}
}
NumberParseState strToDouble(const std::string& input, double& result)
{

View File

@ -27,6 +27,7 @@ namespace DataTypeConverter {
NumberParseState strToInt(const std::string& input, int& result);
NumberParseState strToInt(const std::string& input, unsigned long long& result);
NumberParseState strToInt(const std::string& input, Poco::UInt64& result);
NumberParseState strToDouble(const std::string& input, double& result);
MemoryBin* hexToBin(const std::string& hexString);

View File

@ -121,6 +121,8 @@ namespace model {
// write new group_id in user table
user_model->setGroupId(group_model->getID());
user_model->updateIntoDB("group_id", group_model->getID());
printf("[GroupMemberUpdate::transactionAccepted] finished\n");
}
}
else {

View File

@ -307,7 +307,7 @@ namespace model {
}
//getModel()->updateIntoDB("request", )
printf("[Transaction::sign] reference-count: %d\n", mReferenceCount);
return true;
}
@ -590,6 +590,7 @@ namespace model {
int SendTransactionTask::run()
{
auto result = mTransaction->runSendTransaction();
printf("[SendTransactionTask::run] result: %d\n", result);
// delete because of error
if (-1 == result) {
mTransaction->deleteFromDB();