more logs and check task observer for other running password creation tasks

This commit is contained in:
Dario 2020-09-29 09:04:14 +02:00
parent d54bdcafd0
commit cb3b951234
10 changed files with 68 additions and 1 deletions

BIN
protoc.exe Normal file

Binary file not shown.

View File

@ -212,6 +212,18 @@ std::vector<int> SingletonTaskObserver::getTasksCount(const std::string& email)
return taskCounts;
}
int SingletonTaskObserver::getTasksCount(TaskObserverType type)
{
int type_sum_count = 0;
lock("SingletonTaskObserver::getTasksCount");
for (int i = 0; i < mObserverEntrys.getNItems(); i++) {
UserObserverEntry* entry = static_cast<UserObserverEntry*>(mObserverEntrys.findByIndex(i));
type_sum_count += entry->mTasksCount[type];
}
unlock();
return type_sum_count;
}
const char* SingletonTaskObserver::TaskObserverTypeToString(TaskObserverType type)
{
switch (type) {

View File

@ -46,6 +46,7 @@ public:
int getTaskCount(const std::string& email, TaskObserverType type);
int getTaskCount(DHASH id, TaskObserverType type);
std::vector<int> getTasksCount(const std::string& email);
int getTasksCount(TaskObserverType type);
static const char* TaskObserverTypeToString(TaskObserverType type);
static TaskObserverType StringToTaskObserverType(const std::string& typeString);

View File

@ -817,7 +817,29 @@ UserStates Session::loadUser(const std::string& email, const std::string& passwo
printf("before if login\n");
if (!mSessionUser.isNull() && mSessionUser->getUserState() >= USER_LOADED_FROM_DB) {
printf("before login\n");
int loginResult = mNewUser->login(password);
int loginResult = 0;
int exitCount = 0;
do {
loginResult = mNewUser->login(password);
Poco::Thread::sleep(100);
exitCount++;
} while (-3 == loginResult && exitCount < 15);
if (exitCount > 0) {
addError(new ParamError(functionName, "login succeed, retrys: ", exitCount));
addError(new ParamError(functionName, "email: ", email));
sendErrorsAsEmail();
}
if (exitCount >= 15)
{
auto running_password_creations = observer->getTasksCount(TASK_OBSERVER_PASSWORD_CREATION);
addError(new ParamError(functionName, "login failed after 15 retrys and 100 ms sleep between, currently running passwort creation tasks: ", running_password_creations));
addError(new ParamError(functionName, "email: ", email));
sendErrorsAsEmail();
return USER_PASSWORD_ENCRYPTION_IN_PROCESS;
}
printf("new user login with result: %d\n", loginResult);
if (-1 == loginResult) {

BIN
src/cpsp/PocoFoundation.dll Normal file

Binary file not shown.

BIN
src/cpsp/PocoJSON.dll Normal file

Binary file not shown.

BIN
src/cpsp/PocoNet.dll Normal file

Binary file not shown.

BIN
src/cpsp/PocoUtil.dll Normal file

Binary file not shown.

BIN
src/cpsp/PocoXML.dll Normal file

Binary file not shown.

32
src/cpsp/compile.sh Normal file
View File

@ -0,0 +1,32 @@
#!/bin/bash
cpspc.exe config.cpsp && cp ConfigPage.* ../cpp/HTTPInterface/
cpspc.exe login.cpsp && cp LoginPage.* ../cpp/HTTPInterface/
cpspc.exe resetPassword.cpsp && cp ResetPassword.* ../cpp/HTTPInterface/
cpspc.exe register.cpsp && cp RegisterPage.* ../cpp/HTTPInterface/
cpspc.exe registerAdmin.cpsp && cp RegisterAdminPage.* ../cpp/HTTPInterface/
cpspc.exe dashboard.cpsp && cp DashboardPage.* ../cpp/HTTPInterface/
cpspc.exe checkEmail.cpsp && cp CheckEmailPage.* ../cpp/HTTPInterface/
cpspc.exe saveKeys.cpsp && cp SaveKeysPage.* ../cpp/HTTPInterface/
cpspc.exe passphrase.cpsp && cp PassphrasePage.* ../cpp/HTTPInterface/
cpspc.exe UpdateUserPassword.cpsp && cp UpdateUserPasswordPage.* ../cpp/HTTPInterface/
cpspc.exe Error500.cpsp && cp Error500Page.* ../cpp/HTTPInterface/
cpspc.exe checkTransaction.cpsp && cp CheckTransactionPage.* ../cpp/HTTPInterface/
cpspc.exe decodeTransaction.cpsp && cp DecodeTransactionPage.* ../cpp/HTTPInterface/
cpspc.exe debugPassphrase.cpsp && cp DebugPassphrasePage.* ../cpp/HTTPInterface/
cpspc.exe adminCheckUserBackup.cpsp && cp AdminCheckUserBackup.* ../cpp/HTTPInterface/
cpspc.exe translatePassphrase.cpsp && cp TranslatePassphrase.* ../cpp/HTTPInterface/
cpspc.exe repairDefectPassphrase.cpsp && cp RepairDefectPassphrase.* ../cpp/HTTPInterface/
cpspc.exe PassphrasedTransaction.cpsp && cp PassphrasedTransaction.* ../cpp/HTTPInterface/
cpspc.exe debugMnemonic.cpsp && cp DebugMnemonicPage.* ../cpp/HTTPInterface/
cpspc.exe adminUserPasswordReset.cpsp && cp AdminUserPasswordReset.* ../cpp/HTTPInterface/
cpspc.exe register.cpsp && cp RegisterPage.* ../cpp/HTTPInterface/
cpspc.exe registerDirect.cpsp && cp RegisterDirectPage.* ../cpp/HTTPInterface/
cpspc.exe adminGroups.cpsp && cp AdminGroupsPage.* ../cpp/HTTPInterface/
cpspc.exe adminTopic.cpsp && cp AdminTopicPage.* ../cpp/HTTPInterface/
cpspc.exe adminHederaAccount.cpsp && cp AdminHederaAccountPage.* ../cpp/HTTPInterface/
cpspc.exe adminNodeServer.cpsp && cp AdminNodeServerPage.* ../cpp/HTTPInterface/
cd ../..
./compile_pot.sh
cd src/cpsp