Merge pull request #865 from gradido/login_disable_auto_resend_failed_transactions_restart

disable auto-resend of not finished transactions on login-server restart
This commit is contained in:
einhornimmond 2021-09-21 10:45:08 +02:00 committed by GitHub
commit 4d6964cf4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 18 deletions

View File

@ -57,6 +57,7 @@ namespace ServerConfig {
int g_FakeLoginSleepTime = 820;
std::string g_versionString = "";
bool g_disableEmail = false;
bool g_resendUnfinishedTransactionOnStart = false;
ServerSetupType g_ServerSetupType = SERVER_TYPE_PRODUCTION;
std::string g_devDefaultGroup = "";
std::string g_gRPCRelayServerFullURL;
@ -259,23 +260,7 @@ namespace ServerConfig {
g_AllowUnsecureFlags = (AllowUnsecure)(g_AllowUnsecureFlags | UNSECURE_ALLOW_ALL_PASSWORDS);
}
g_gRPCRelayServerFullURL = cfg.getString("grpc.server", "");
// unsecure flags
//g_AllowUnsecureFlags
if (cfg.getInt("unsecure.allow_passwort_via_json_request", 0) == 1) {
g_AllowUnsecureFlags = (AllowUnsecure)(g_AllowUnsecureFlags | UNSECURE_PASSWORD_REQUESTS);
}
if (cfg.getInt("unsecure.allow_auto_sign_transactions", 0) == 1) {
g_AllowUnsecureFlags = (AllowUnsecure)(g_AllowUnsecureFlags | UNSECURE_AUTO_SIGN_TRANSACTIONS);
}
if (cfg.getInt("unsecure.allow_cors_all", 0) == 1) {
g_AllowUnsecureFlags = (AllowUnsecure)(g_AllowUnsecureFlags | UNSECURE_CORS_ALL);
}
if (cfg.getInt("unsecure.allow_all_passwords", 0) == 1) {
g_AllowUnsecureFlags = (AllowUnsecure)(g_AllowUnsecureFlags | UNSECURE_ALLOW_ALL_PASSWORDS);
}
g_resendUnfinishedTransactionOnStart = cfg.getBool("dev.resend_unfinished_transactions_on_start", false);
return true;
}

View File

@ -73,6 +73,7 @@ namespace ServerConfig {
extern int g_FakeLoginSleepTime;
extern std::string g_versionString;
extern bool g_disableEmail;
extern bool g_resendUnfinishedTransactionOnStart;
extern ServerSetupType g_ServerSetupType;
extern std::string g_devDefaultGroup;
extern std::string g_gRPCRelayServerFullURL;

View File

@ -204,7 +204,7 @@ namespace model {
}
}
// try not finished but signed transactions again
if (!finished) {
if (!finished && ServerConfig::g_resendUnfinishedTransactionOnStart) {
transaction->ifEnoughSignsProceed(nullptr);
}