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:
einhornimmond 2021-05-24 11:55:23 +02:00 committed by GitHub
commit 47dd4adf0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -180,7 +180,9 @@ std::vector<Poco::AutoPtr<controller::PendingTask>> PendingTasksManager::getTran
void PendingTasksManager::checkForFinishedTasks(Poco::Timer& timer)
{
static const char* function_name = "PendingTasksManager::checkForFinishedTasks";
Poco::ScopedLock<Poco::Mutex> _lock(mWorkMutex);
try {
for (auto map_it = mPendingTasks.begin(); map_it != mPendingTasks.end(); map_it++)
{
@ -200,11 +202,21 @@ void PendingTasksManager::checkForFinishedTasks(Poco::Timer& timer)
if (removeIt) {
transaction->deleteFromDB();
list_it = list->erase(list_it);
if (!list->size()) break;
if (!list->size() || list_it == list->end()) 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)