Пример #1
0
        private static void ProcessBlock()
        {
            var currentTimestamp = Utilities.GetCurrentTimestamp();

            while (true)
            {
                if (!GlobalVars.Data.BlockQueue.TryPeek(out var blockStruct))
                {
                    break;
                }

                if (blockStruct.ExpirationTime < currentTimestamp)
                {
                    CloudflareUtilities.Unblock(blockStruct.BlockId);
                    Console.WriteLine($"Unblocked IP: {blockStruct.IpAddress} (Id = {blockStruct.BlockId})");

                    GlobalVars.Data.BlockQueue.Dequeue();
                    GlobalVars.Data.BlockHashSet.Remove(blockStruct.IpAddress);

                    _dataChanged = true;
                }
                else
                {
                    break;
                }
            }
        }