mirror of
https://github.com/RPCS3/discord-bot.git
synced 2024-11-27 20:20:23 +00:00
fix warn stats after migrating to ef core 3.0
This commit is contained in:
parent
34e6581f8d
commit
e62cd795ae
@ -94,7 +94,7 @@ namespace CompatBot.Commands
|
||||
}
|
||||
var yesterday = DateTime.UtcNow.AddDays(-1).Ticks;
|
||||
var warnCount = db.Warning.Count(w => w.Timestamp > yesterday);
|
||||
var lastWarn = db.Warning.LastOrDefault()?.Timestamp;
|
||||
var lastWarn = timestamps.Any() ? timestamps.Last() : (long?)null;
|
||||
if (lastWarn.HasValue)
|
||||
longestGapBetweenWarning = Math.Max(longestGapBetweenWarning, DateTime.UtcNow.Ticks - lastWarn.Value);
|
||||
// most warnings per 24h
|
||||
|
Loading…
Reference in New Issue
Block a user