1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

a ton of stuff and fix migations

This commit is contained in:
RaidMax
2018-09-23 19:45:54 -05:00
parent 134f16861e
commit 6b8c112ccf
45 changed files with 706 additions and 461 deletions

View File

@ -1,8 +1,6 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading.Tasks;
using SharedLibraryCore.Database;
using SharedLibraryCore.Database.Models;
using SharedLibraryCore.Dtos;
namespace SharedLibraryCore.Events
@ -10,7 +8,7 @@ namespace SharedLibraryCore.Events
public class EventApi
{
const int MaxEvents = 100;
static Queue<EventInfo> RecentEvents = new Queue<EventInfo>();
static ConcurrentQueue<EventInfo> RecentEvents = new ConcurrentQueue<EventInfo>();
public static IEnumerable<EventInfo> GetEvents(bool shouldConsume)
{
@ -75,7 +73,7 @@ namespace SharedLibraryCore.Events
{
// remove the first added event
if (RecentEvents.Count >= MaxEvents)
RecentEvents.Dequeue();
RecentEvents.TryDequeue(out _);
RecentEvents.Enqueue(info);
}