things to get more infos for debugging

This commit is contained in:
einhorn_b 2021-06-16 12:49:58 +02:00
parent 7785a0b5a6
commit 0093ae8834
4 changed files with 31 additions and 12 deletions

View File

@ -289,7 +289,7 @@ class AppController extends Controller
}
} else {
if(!$redirect) {
return ['state' => 'not found', 'msg' => 'invalid session'];
return ['state' => 'not found', 'msg' => 'invalid session', 'details' => $json];
}
if ($json['state'] === 'not found') {
$this->Flash->error(__('invalid session'));

View File

@ -359,7 +359,8 @@ namespace model {
//UniLib::controller::TaskPtr transaction_send_task(new SendTransactionTask(Poco::AutoPtr<Transaction>(this, true)));
//transaction_send_task->scheduleTask(transaction_send_task);
auto pt = PendingTasksManager::getInstance();
pt->removeTask(this);
pt->removeTask(Poco::AutoPtr<Transaction>(this, true));
return 1 == runSendTransaction();
//return true;
}
@ -562,13 +563,13 @@ namespace model {
auto result = json_request.request("putTransaction", param);
json_request.getWarnings(&json_request);
if (JSON_REQUEST_RETURN_OK == result)
{
if (JSON_REQUEST_RETURN_OK == result)
{
if (!json_request.errorCount()) {
finishSuccess();
}
else {
getErrors(&json_request);
getErrors(&json_request);
return -1;
}
return 1;

View File

@ -56,9 +56,9 @@ namespace model {
try {
auto res = select.execute();
if (1 == res) { return true; }
}
catch (Poco::Exception& ex) {
catch (Poco::Exception& ex) {
addError(new ParamError(getTableName(), "mysql error by select id", ex.displayText().data()));
addError(new ParamError(getTableName(), "data set: ", toString().data()));
}
@ -124,21 +124,35 @@ namespace model {
void ModelBase::duplicate()
{
Poco::ScopedLock<Poco::Mutex> _lock(mWorkMutex);
//Poco::ScopedLock<Poco::Mutex> _lock(mWorkMutex);
std::string stack_details = "[ModelBase::duplicate] table: ";
stack_details += getTableName();
lock(stack_details.data());
mReferenceCount++;
printf("[ModelBase::duplicate] new value: %d, table name: %s\n", mReferenceCount, getTableName());
unlock();
//printf("[ModelBase::duplicate] new value: %d\n", mReferenceCount);
}
void ModelBase::release()
{
Poco::ScopedLock<Poco::Mutex> _lock(mWorkMutex);
if(mReferenceCount <= 0) {
throw Poco::Exception("ModelBase already released", getTableName());
}
std::string stack_details = "[ModelBase::release] table: ";
stack_details += getTableName();
stack_details += ", reference count: ";
stack_details += std::to_string(mReferenceCount);
lock(stack_details.data());
mReferenceCount--;
//printf("[ModelBase::release] new value: %d\n", mReferenceCount);
printf("[ModelBase::release] new value: %d, table name: %s\n", mReferenceCount, getTableName());
if (0 == mReferenceCount) {
unlock();
delete this;
return;
}
unlock();
}
@ -180,7 +194,7 @@ namespace model {
Poco::Mutex& timeMutex = ServerConfig::g_TimeMutex;
int year, month, day, hour, minute, second;
// ex: 2009-10-29
// ex: 2009-10-29
if (sscanf(decodedDateString.data(), "%d-%d-%dT%d:%dZ", &year, &month, &day, &hour, &minute) != EOF) {
time_t rawTime;
time(&rawTime);

View File

@ -70,7 +70,11 @@ namespace model
{
SHARED_LOCK;
temp = mResultJsonString;
if(!mResultJsonString.size()) {
return new Poco::JSON::Object;
}
}
Poco::JSON::Parser parser;
Poco::Dynamic::Var result;
try