Fix veto reg login (1 minuto) x evitare doppie rec
This commit is contained in:
@@ -27,6 +27,11 @@ namespace MP_TAB3.Pages
|
||||
|
||||
protected int expDays = 1;
|
||||
protected bool recordLogin = true;
|
||||
protected bool vetoRecord
|
||||
{
|
||||
get => MsgServ.VetoRecordLogin;
|
||||
set => MsgServ.VetoRecordLogin = value;
|
||||
}
|
||||
|
||||
protected string txtError = "";
|
||||
protected DateTime vetoScan = DateTime.Now;
|
||||
@@ -113,9 +118,10 @@ namespace MP_TAB3.Pages
|
||||
await TDService.OperatoreSetRedis(matrOpr, hash, devGuid);
|
||||
|
||||
// se abilitato in config...
|
||||
|
||||
if (recordLogin)
|
||||
if (recordLogin && !vetoRecord)
|
||||
{
|
||||
// imposto veto (TTL: 60sec hard-coded)
|
||||
vetoRecord = true;
|
||||
// salvo registrazione login utente
|
||||
string generOpr = $"{rigaOpr.Cognome} {rigaOpr.Nome}";
|
||||
RegistroDichiarazioniModel ulRec = new RegistroDichiarazioniModel()
|
||||
|
||||
@@ -164,6 +164,24 @@ namespace MP.Data.Services
|
||||
set => redisHashDictSet((RedisKey)$"{redisBaseKey}:{MatrOpr}", value);
|
||||
}
|
||||
|
||||
public bool VetoRecordLogin
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = false;
|
||||
string rawData = redisDb.StringGet((RedisKey)$"{redisBaseKey}:VetoLoginRec:{MatrOpr}");
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
answ = true;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
set
|
||||
{
|
||||
redisDb.StringSet((RedisKey)$"{redisBaseKey}:VetoLoginRec:{MatrOpr}", value, TimeSpan.FromSeconds(60));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
Reference in New Issue
Block a user