mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #448 from gradido/login_fix_kw_20
everything I find and fix crash related in login server this week (kw 20)
This commit is contained in:
commit
47dd4adf0a
@ -180,31 +180,43 @@ std::vector<Poco::AutoPtr<controller::PendingTask>> PendingTasksManager::getTran
|
|||||||
|
|
||||||
void PendingTasksManager::checkForFinishedTasks(Poco::Timer& timer)
|
void PendingTasksManager::checkForFinishedTasks(Poco::Timer& timer)
|
||||||
{
|
{
|
||||||
|
static const char* function_name = "PendingTasksManager::checkForFinishedTasks";
|
||||||
Poco::ScopedLock<Poco::Mutex> _lock(mWorkMutex);
|
Poco::ScopedLock<Poco::Mutex> _lock(mWorkMutex);
|
||||||
|
try {
|
||||||
|
|
||||||
for (auto map_it = mPendingTasks.begin(); map_it != mPendingTasks.end(); map_it++)
|
for (auto map_it = mPendingTasks.begin(); map_it != mPendingTasks.end(); map_it++)
|
||||||
{
|
|
||||||
auto list = map_it->second;
|
|
||||||
for (auto list_it = list->begin(); list_it != list->end(); list_it++)
|
|
||||||
{
|
{
|
||||||
if ((*list_it)->getModel()->isGradidoTransaction()) {
|
auto list = map_it->second;
|
||||||
auto transaction = dynamic_cast<model::gradido::Transaction*>(list_it->get());
|
for (auto list_it = list->begin(); list_it != list->end(); list_it++)
|
||||||
auto json = transaction->getModel()->getResultJson();
|
{
|
||||||
bool removeIt = false;
|
if ((*list_it)->getModel()->isGradidoTransaction()) {
|
||||||
if (!json.isNull()) {
|
auto transaction = dynamic_cast<model::gradido::Transaction*>(list_it->get());
|
||||||
auto state = json->get("state");
|
auto json = transaction->getModel()->getResultJson();
|
||||||
if (!state.isEmpty() && state.toString() == "success") {
|
bool removeIt = false;
|
||||||
removeIt = true;
|
if (!json.isNull()) {
|
||||||
|
auto state = json->get("state");
|
||||||
|
if (!state.isEmpty() && state.toString() == "success") {
|
||||||
|
removeIt = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (removeIt) {
|
||||||
|
transaction->deleteFromDB();
|
||||||
|
list_it = list->erase(list_it);
|
||||||
|
if (!list->size() || list_it == list->end()) break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (removeIt) {
|
|
||||||
transaction->deleteFromDB();
|
|
||||||
list_it = list->erase(list_it);
|
|
||||||
if (!list->size()) break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Poco::Exception& ex) {
|
||||||
|
NotificationList errors;
|
||||||
|
errors.addError(new ParamError(function_name, "poco exception", ex.displayText()));
|
||||||
|
errors.sendErrorsAsEmail();
|
||||||
|
} catch(std::exception& ex) {
|
||||||
|
NotificationList errors;
|
||||||
|
errors.addError(new ParamError(function_name, "std::exception", ex.what()));
|
||||||
|
errors.sendErrorsAsEmail();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Poco::AutoPtr<controller::PendingTask> PendingTasksManager::getPendingTask(int pendingTaskId)
|
Poco::AutoPtr<controller::PendingTask> PendingTasksManager::getPendingTask(int pendingTaskId)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user