mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
things to get more infos for debugging
This commit is contained in:
parent
7785a0b5a6
commit
0093ae8834
@ -289,7 +289,7 @@ class AppController extends Controller
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(!$redirect) {
|
if(!$redirect) {
|
||||||
return ['state' => 'not found', 'msg' => 'invalid session'];
|
return ['state' => 'not found', 'msg' => 'invalid session', 'details' => $json];
|
||||||
}
|
}
|
||||||
if ($json['state'] === 'not found') {
|
if ($json['state'] === 'not found') {
|
||||||
$this->Flash->error(__('invalid session'));
|
$this->Flash->error(__('invalid session'));
|
||||||
|
|||||||
@ -359,7 +359,8 @@ namespace model {
|
|||||||
//UniLib::controller::TaskPtr transaction_send_task(new SendTransactionTask(Poco::AutoPtr<Transaction>(this, true)));
|
//UniLib::controller::TaskPtr transaction_send_task(new SendTransactionTask(Poco::AutoPtr<Transaction>(this, true)));
|
||||||
//transaction_send_task->scheduleTask(transaction_send_task);
|
//transaction_send_task->scheduleTask(transaction_send_task);
|
||||||
auto pt = PendingTasksManager::getInstance();
|
auto pt = PendingTasksManager::getInstance();
|
||||||
pt->removeTask(this);
|
|
||||||
|
pt->removeTask(Poco::AutoPtr<Transaction>(this, true));
|
||||||
return 1 == runSendTransaction();
|
return 1 == runSendTransaction();
|
||||||
//return true;
|
//return true;
|
||||||
}
|
}
|
||||||
@ -562,13 +563,13 @@ namespace model {
|
|||||||
auto result = json_request.request("putTransaction", param);
|
auto result = json_request.request("putTransaction", param);
|
||||||
json_request.getWarnings(&json_request);
|
json_request.getWarnings(&json_request);
|
||||||
|
|
||||||
if (JSON_REQUEST_RETURN_OK == result)
|
if (JSON_REQUEST_RETURN_OK == result)
|
||||||
{
|
{
|
||||||
if (!json_request.errorCount()) {
|
if (!json_request.errorCount()) {
|
||||||
finishSuccess();
|
finishSuccess();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
getErrors(&json_request);
|
getErrors(&json_request);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@ -56,9 +56,9 @@ namespace model {
|
|||||||
try {
|
try {
|
||||||
auto res = select.execute();
|
auto res = select.execute();
|
||||||
if (1 == res) { return true; }
|
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(), "mysql error by select id", ex.displayText().data()));
|
||||||
addError(new ParamError(getTableName(), "data set: ", toString().data()));
|
addError(new ParamError(getTableName(), "data set: ", toString().data()));
|
||||||
}
|
}
|
||||||
@ -124,21 +124,35 @@ namespace model {
|
|||||||
|
|
||||||
void ModelBase::duplicate()
|
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++;
|
mReferenceCount++;
|
||||||
|
printf("[ModelBase::duplicate] new value: %d, table name: %s\n", mReferenceCount, getTableName());
|
||||||
|
unlock();
|
||||||
//printf("[ModelBase::duplicate] new value: %d\n", mReferenceCount);
|
//printf("[ModelBase::duplicate] new value: %d\n", mReferenceCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelBase::release()
|
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--;
|
mReferenceCount--;
|
||||||
//printf("[ModelBase::release] new value: %d\n", mReferenceCount);
|
printf("[ModelBase::release] new value: %d, table name: %s\n", mReferenceCount, getTableName());
|
||||||
if (0 == mReferenceCount) {
|
if (0 == mReferenceCount) {
|
||||||
|
unlock();
|
||||||
delete this;
|
delete this;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
unlock();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,7 +194,7 @@ namespace model {
|
|||||||
Poco::Mutex& timeMutex = ServerConfig::g_TimeMutex;
|
Poco::Mutex& timeMutex = ServerConfig::g_TimeMutex;
|
||||||
|
|
||||||
int year, month, day, hour, minute, second;
|
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) {
|
if (sscanf(decodedDateString.data(), "%d-%d-%dT%d:%dZ", &year, &month, &day, &hour, &minute) != EOF) {
|
||||||
time_t rawTime;
|
time_t rawTime;
|
||||||
time(&rawTime);
|
time(&rawTime);
|
||||||
|
|||||||
@ -70,7 +70,11 @@ namespace model
|
|||||||
{
|
{
|
||||||
SHARED_LOCK;
|
SHARED_LOCK;
|
||||||
temp = mResultJsonString;
|
temp = mResultJsonString;
|
||||||
|
if(!mResultJsonString.size()) {
|
||||||
|
return new Poco::JSON::Object;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Poco::JSON::Parser parser;
|
Poco::JSON::Parser parser;
|
||||||
Poco::Dynamic::Var result;
|
Poco::Dynamic::Var result;
|
||||||
try
|
try
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user