private async void SaveMeasurement (TimeCorrectionData data) { var dataStore = ServiceContainer.Resolve<IDataStore> (); await dataStore.ExecuteInTransactionAsync (ctx => { ctx.PurgeDatedTimeCorrections (data.MeasuredAt - TimeSpan.FromDays (1)); ctx.Put (data); }).ConfigureAwait (false); }
public void AddMeasurement (TimeCorrectionData data) { lock (syncRoot) { sample.Enqueue (data); lastCorrection = null; while (sample.Count >= SampleSize) { sample.Dequeue (); } } }