示例#1
0
        private void Flush()
        {
            // theoretically, not a fully thread-safe rotation
            var previousBuffer = _buffer;

            _buffer = new ConcurrentQueue <Log>();

            var testRun = RunContext.GetCurrentTestRun();

            if (testRun != null)
            {
                var logs = new List <Log>();
                logs.AddRange(previousBuffer);

                _apiClient.SendLogs(testRun.Id, logs);
            }
        }