parent
71bb5b70af
commit
9fa97e2fc9
@ -351,14 +351,16 @@ namespace SQLiteRepository
|
||||
var logDirection = GetLogDirection(ident.UserId_FK);
|
||||
|
||||
#region Check the user hasnt registered an event in the last few minutes..
|
||||
|
||||
//BUG: what happens if unassociated cards are swiped within the threshold? need to get all of them.
|
||||
var hysteresisThresholdMinutes = Convert.ToInt32(ConfigurationManager.AppSettings["SwipeTimeGap"] ?? "3");
|
||||
var threshold = DateTime.UtcNow.AddMinutes(0 - hysteresisThresholdMinutes);
|
||||
var logs = _connection.Query<TimeLogDb>(
|
||||
SQLiteProcedures.GET_LOGS_IN_LAST_X_MINUTES,
|
||||
threshold.Ticks, ident.UserId_FK);
|
||||
_logger.Trace("Checking last swipe event gap");
|
||||
if (logs.Any())
|
||||
{
|
||||
_logger.Error("Not logging event for user id: {0}, logged event within TimeGap Threshold of {1}", ident.UserId_FK, threshold);
|
||||
logId = -1;
|
||||
return OperationResponse.FAILED;
|
||||
}
|
||||
|
||||
@ -45,6 +45,7 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SQLite, Version=1.0.104.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Data.SQLite.Core.1.0.104.0\lib\net451\System.Data.SQLite.dll</HintPath>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user